Colour Sample Map Keys by Sampler ID? // Help.
-
I know how to colour the keyboard keys by samplemaps, but If I have two 'Samplers' how do I separate the colours for them? At this time, both 'Samplers' are showing their mappings in the same colour, I'd like to separate them by colour and possibly just do some general identifiers per Sampler. Can anyone help with this?
This is for one sampler. Can you help modify? Im not sure how to call on separate samplers maps.
const samplerIds = Synth.getIdList("Sampler"); const samplers = []; for (id in samplerIds) samplers.push(Synth.getSampler(id)); pnlPreLoad.setLoadingCallback(function(isPreloading) { if (!isPreloading) { setKeyColours(); } }); inline function setKeyColours() { for (i = 0; i < 128; i++) { Engine.setKeyColour(i, Colours.withAlpha(Colours.black, 0.90)); } for (i = 0; i < 128; i++) { for (s in samplers) { if (s.isNoteNumberMapped(i)) { Engine.setKeyColour(i, Colours.withAlpha(0xFF327E66, 0.6)); } } } } setKeyColours();
-
@Chazrox basic JS stuff:
inline function setKeyColours() { for(i = 0; i < 128; i++) { if(samplers[0].isNoteNumberMapped(i)) { Engine.setKeyColour(i, Colours.red); } else if(samplers[1].isNoteNumberMapped(i)) { Engine.setKeyColour(i, Colours.blue); } else { Engine.setKeyColour(i, Colours.white); } } }
-
@Christoph-Hart Thank you sir.
-
sweeet!