Dynamic keyboard colouring
-
Put the buttons and panels into arrays then in your updateCode function you can just assign the colour to the panel index that matches the button index.
If you have no idea what I'm talking about you should watch this
-
So i watched the video tutorial @d-healey suggested.
It has helped A Lot!
I've managed to associate/index buttons to Panels and Labels to change their colour, but....
I can't manage to get the keyboard keys to colour correctly.Instead of colouring a single key(associated/indexed) to a button which is pointing to Sampler1, it colours all Samplers from the Sampler array(SMP).
I can't figure out where its going wrong...
Please help!Also the Panels and Labels don't save their colour. Is there any easy way to save their state? I'm guessing i have to code this manually?
Thanks!
HiseSnippet 3810.3oc6as0baabEFTRvVjIJW7jNsclzYPUZ6PEKSQRcw1Q1MjRhzV0TRbHkkcFOdTVArhDiAAv..JIFOdper8mPequzGZdp+D768kNS+CjeB4WPcOmcwkEfWDkhrqSiXRPvd1yt641d1ucwp5NVpTWWKGoTo2smMUJ06K2rmoW60aSzMk1bCoTSKu9N014gMjVqmMw0kpIkJ0j2CqMU5ojX+99ubMhAwTkFQRRZOKcUZM8N5dQT+5ROP2vnJQitqdGAtWpzlpVlqaYX0EjjIkyKYSTeFoEcaBx1DxRotREMcOKmldDOpqTpoVyRqWy1VGax4eOcW8CLnXgBRMgNhStpkgFJwHUo0aqanUOPickjRc05Q5+jb8+Sj2RWSOjdjc3iXUnD0BQ6QpIFk3UPT7xO9hWJAwaJt38wxMUczs8hpAksOTdKPL2zzi5bHAbChhFmeoI9Yer75V.Gld45PdFspCTHrEYu0x4mWY474ma0Lyjwg1RQeU++eQ+WTcCdg4lTtqxSd5pBDZ54na1Z0LY.OoqmxQDGEhgcaBvXv3Rzzdfo0AYmsLVwryq.iINhJvOFu4bodMHlsnYgZJt7xyqTHY0Ym00qmAEZ7r6Qc7zUIFy1OO5dzN7vIbTNoZ0xre8y3AshwVd1OfsHkvgpMHUnAUCZyxEhz.fwgK+9UNBoOji9jctXkjsSWxa4PolCR1uGVAztB4KFI9LtGtBDV8.DvUVpZ0kpzOiCSDSv1.MIQpwAFcoCRKVCniJwxKFoDHuCW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tqmUG9Zx.g5U34wRENaAht+uvjIl1N
-
SMP[i].getChildSynthByIndex(idx == i);
That doesn't do anything.
local idx = SMP_COLOUR_buttons.indexOf(component);
That doesn't do anything either (really it should return an error) since there is no
component
in that function. So what it will always give you is the value 0.or (i2 = 0; i2 < 127; i2++)
Something just feels wrong about a variable calledi2
call itj
ork
orx
or something less weird :pWhat's this for?
(idx == i);
-
@d-healey said in Dynamic keyboard colouring:
SMP[i].getChildSynthByIndex(idx == i);
That doesn't do anything.I don't know what else to call...
Im trying to get the index for a sampler based on what button that was pressed so I could colour the correct key(inside theupdateCode()
block),local idx = SMP_COLOUR_buttons.indexOf(component);
That doesn't do anything either (really it should return an error) since there is nocomponent
in that function. So what it will always give you is the value 0.Appologies, I should have removed it from
updateCode()
But, on line 60 (inside theonbtn_COLOUR_SMP_Control
) its calling the index of the buttons.What's this for?
(idx == i);
Index of a button. ??
Heres an updated snippet;
HiseSnippet 3797.3oc6a0sbaabEFTxvVjIJwwSlosyjNCpRaGpXYIRpercjcConHsUMkDGRYYmwiGkU.qHgMH.F.PIw3QSyksOB8tbSun4p9H366Mcl9BjGg7DT2yYW7yBveDkirqSiXaf4d1yt624mc2ucITcGKUpqqkiTpz6zylJk58ka1yzqc41DcSoMVWJ0Txk2t11OrgzZ8rIttTMoTol7dXsoReII1me3KViXPLUoQhjj10RWkVSuitWjzup3CzMLpRzn6n2QP6kJtgpkYYKCqt.RlTNmjMQ84jVzsHnZSHKk5xUzz8rbZ5Q7ntRotzZVZ8Z115HSt96p6puuAEKjWpIzQbwUsLzPDiRkJ2V2PqdfE6JIk5J0ir+I41+GKuotldn7H+vUYUnD0BQ+QpIFE7xKBubiO7RI.uKwg2GI2T0Q21KpFDaen7l.L2vzi5b.ABChPiquzDtWUtrEngo27cHOmV0AJD1hr2Z4byorbtbytZloy3PaonuJ+eel++p5F7EVTR4tJO4oqJHnomitYqUyjABjtdJGRbTHF1sIfhACKQS6AlV6mclRXEyLmBLj3.p.eX5NuK0qAwrE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hCInD51BKtGeLeO4Gg+ImyRzYu1MSIeCv8iiK6MugAACqiDpnsdq1A0nG9SRhnCe+frLM54OyNt0cE9KR2HLtDMHs7lXYkEO6MYoydSV9r2jUN6M4lm8lbqQ0DjUZotdVc36ICBpWguNVpvYKP18+EfgRBUO
but I'm still puzzled on how to correct this.
-
SMP[i].getChildSynthByIndex(idx == i);
This line isn't doing anything for a couple of reasons. Firstly you are not storing the return value anywhere. It should be
variable = function();
.
But this won't work anyway because SMP is already an array of child synths, you have this on line 53
SMP[i] = Synth.getChildSynth("SMP" + (i+1));
Im trying to get the index for a sampler based on what button that was pressed so I could colour the correct key
Why do you need the index of the sampler when you have the index of the button?
-
You're right, I don't need the index of the sampler.
In the SMP loop from @Line 71
SMP[i].getChildSynthByIndex(idx == i);
I can't use.showControl
for the keyboard. What else can I do? -
@ten7kur Just get rid of that line because it's not needed.
-
@d-healey
Even if I remove the SMP for loop, I still have the problem of both sampler1 and sampler2 keys being coloured on the keyboard. -
@ten7kur I know but removing any code that is not doing anything will make it easier to work out what needs to be fixed.
-
@d-healey
Yes. That is true.
I actually had the code like this before. :exclamation_question_mark: I don't understand why its colouring both sampler keys... -
Any thoughts?
-
I don't have time at the moment to look through the code again, so for now you're on your own. I'll have another look when I get chance.
-
@d-healey
Ok. Thanks. Appreciate it!
Ill keep trying..