Interface Keyboard Color in condition to played chord / midinotes
-
Hey there, i was inspired by @d-healey Youtubevideo on custom Keyboard Color and wanted to build something, that displays the currently played notes on the keyboard in the interface. Again it´s working inside HISE, but not when exported to Midi FX AU and used in Logic.
Here´s my Interface onNoteOn function:
function onNoteOn() { for (i = 0; i < 128; i++) { if (chord.contains(i)) { Engine.setKeyColour(i, Colours.withAlpha(Colours.blue, 0.4)); } } }
Anyone any Idea, why it´s working inside HISE but not on the PluginInterface?
-
try putting your code in the code formatter - its easier for us to read - its this button in the forum editor: </>
what's "chord"? some sort of array of held notes? why not just use:
Synth.isKeyDown(int noteNumber)
-
Hey Lindon, sorry, for the wrong format, and thanks for your tip! i´m new to this =) sat a lot of hours yesterday to figure this small piece of code out. :D
We build some kind of chord trigger, that get´s chord arrays from atm a json.
So you have around 8-10 chords in one set, that are mapped onto the keys. everything still pretty raw.
I defined a global var in the scriptprocessor, that holds the currently played "artificial" notes to get the current mapped notes into the interfacescript. Thats "chord".
The script is doing what i intended inside the HISE Environment but not after exporting.
That so far.