Custom custom keyboard :)
-
Hi, I haven't found any solution with:
Highlighting the keys of the custom keyboard when the MIDI keyboard is played.
Coloring keys when the note is mapped (it works with the basic keyboard, but I haven't found anything with the custom keyboard).
Are there any solutions to resolve it? Thanks. -
-
@d-healey I have the tutorial memorized, and I don't think these points are mentioned :)
-
Your on note callback should call repaint for your custom keyboard panel, and the keyboard panel paint routine should, as it draws keys, look for Synth.isKeyDown().
-
@aaronventure How you know the id of the key item in custom keyboard ?
I tried g.id or obj.id, it didn't work.
This can be useful for modifying each key individually.keyboardLaf.registerFunction("drawWhiteNote", function(g, obj) { var a = obj.area; g.setColour(obj.hover ? grey1 : white1); g.fillRect([a[0], a[3] - a[3], a[2] , a[3] ]); g.setColour(grey1); g.drawRect([a[0], a[3] - a[3] , 1, a[3] ], 1); });; keyboardLaf.registerFunction("drawBlackNote", function(g, obj) { var a = obj.area; var colour = blue3; g.setColour(obj.hover ? blue2 : blue3); g.fillRoundedRectangle([a[0], a[1]-10*zoom, a[2], a[3] / 1.1], 7*zoom); });
-
@Lumi283 said in Custom custom keyboard :):
How you know the id of the key item in custom keyboard ?
By ID do you mean note number?
Put this in your laf function to see all the properties you have available:
Console.print(trace(obj));
-
-
@aaronventure @d-healey thank you!