Automatic limit keys on keyboard (floatTile)
-
Hello HISE Community!
I want to make my keyboard looks like that below, showing the notes outside the sampler range with black shadow:I managed to use panels to do that, like this:
But it is not efficient at all. There are any way to make it easily?
Thanks in advance!
-
@Gabriel-Strozi There are functions to set the color of individual keys, check the api docs
-
The problem is that I don't even know what API is
Could you give me more info about this way to go, please? How do I use those functions? Where can I find those functions?
I'm learning a lot of new concepts of programming with this project. I really appreciate if you could give more info!
Thanks!
-
Would it be the Engine.setKeyColour() ?
-
I managed Engine.setKeyColour() to work by clicking a button.
I'm thinking of creating a loop to check what key have samples loaded, using Sampler.isNoteNumberMapped(). You think it is a good way?
-
I found the way!
On load sample map function I called:for (i = 0; i < 128; i++) { Console.print(i); var x = Instrumento.isNoteNumberMapped(i); if (x == 1) { Engine.setKeyColour(i, 0x00000000); } else Engine.setKeyColour(i, 0x90000000); }
I'm really happy that I figured out by myself how to do that, of course you some footprints you gave me @d-healey !
Thanks you so much!
-
@Gabriel-Strozi just to give a hint on scripting basics (but I strongly suggest you watch @d-healey videos)
This
for (i = 0; i < 128; i++) { var x = Instrumento.isNoteNumberMapped(i); if (x == 1) { Engine.setKeyColour(i, 0x00000000); } else Engine.setKeyColour(i, 0x90000000); }
Since the variable
x
is boolean, can be replaced directlyfor (i = 0; i < 128; i++) { if (Instrumento.isNoteNumberMapped(i)) Engine.setKeyColour(i, 0x00000000); else Engine.setKeyColour(i, 0x90000000); }
You could also have set the colour with a ternary operator:
for (i = 0; i < 128; i++) { var colour = Instrumento.isNoteNumberMapped(i) ? 0x00000000 : 0x90000000; Engine.setKeyColour(i, colour); }
And the whole thing can be replaced:
for (i = 0; i < 128; i++) { Engine.setKeyColour(i, Instrumento.isNoteNumberMapped(i) ? 0x00000000 : 0x90000000); }
-
-
I also tried on my music player.
-
@DearieSamson said in Automatic limit keys on keyboard (floatTile):
I also tried on my music player.
El vaig instal路lar al meu ordinador com a to de trucada mp3 a klingeltone-kostenlos.de