Dynamic keyboard colouring
-
@d-healey said in Dynamic keyboard colouring:
It will be easier to assist if you post a HISE snippet
Sure!
HiseSnippet 3132.3oc6as0aabbEdojVYQlnbwH.sEHOrgosfBQQlj5lcTCBknDsUijsfnhcJBBbFs6PxAd4NK1cntTCCzG6uf7bdNO0eBF809X+CjeB4w9TUOmY1KyRRIQkH6X2PBi06blyLy24Lm4LeyPp8B31zvPdfQt7GbpO0H2aZ17TOQm5cHLOis2zH2zlaR6xM13TeRXH0wHWtIuKVWt7SYH+7ie1FDWhmMMUjgwC4La5NrtLQpzuo1mybcaPbnGv5po8R011l6Um6x6A3XRyxF9D6mPZSuOAUaBS.Da4vD7flBhfFZjapM3Nm1rC+XOk9OjExNzkhEpXzD5Hk3FbWGDwnTi5cXtN6EaugFF4twdoV+jJq+8L2k4vRjm5EdGYEVosP2ejahKBdUzgW4QGd4zf2TJ38tlMsCX9hzZPr81l6BvbaOAMnEAlFzglReiIt4aXVmCZ3IVHjJdDyQzozsWt7bqMaAM42ixZ2QTZ4xxJls.LsDJrNhDXER556RCBs9Tqu5qWypPb4up7WChjgLKzlJjVgrTohMUpTo3bqUnPg.ZaK1Zx+yVNSq5IMAMEALu1ftoiJw0uCATLFhDGmO2ieXohqiUTbdqxv+ft2B9H0EMh8IdsokfZpt7xyaUo+pKULTbpKEZbwGRCDLahawA0gIncUQj3nbRiFqK+LnhG1NiZkke.0RMh.pyvLg8oNPaprrlI.Zd9FPTkW.7SzX.vqvU+pc4Puc.k5MLveWrBncKVVC9RsOeCHo5g.vUVpQik1ZPEOOH1mZC0kjZFG51iNLqXCPNzpkzmCPcOeaHt1KXVHUkArxJ0KWtQiAz67LRMKvl6zmErC4PpaohXEXXzJ.RWUM44L5cquma83EiZ88dDOruSpUsPCyVTHQlZLNFSjnBiGrxNxrIEGVK2CRXI1m2Sv7nkZ0yyVv3dkZO2SauPKXOh0ccK4SBBoPRsR5YGlat0dFzWXtIlmKzXq3FCtHuifohC32idRoilqvSKjGyszgdxADH4Klt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.get("text"));
orEngine.setKeyColour(i, cs);
the key does not colour. -
There are a couple of things.
Passing a string to
Engine.setKeyColour()
won't work. It needs to be a number or hex value. The simplest solution is to convert it to an integer.parseInt(cs);
should work.You are setting the key colour in
on init
. This is only triggered once, when the instrument is first opened. You need this code to be triggered every time the colour is changed. That hex picker I wrote is an old script, I'd structure it quite differently now but in the current state I think your best option is to set the key colour inside yourupdateCode()
function. -
@d-healey said in Dynamic keyboard colouring:
parseInt(cs); should work
It does work! Thanks so much!
-
Coming back to this. Now that the basics are working..
Im trying to create the ability to colour the background of a Specific panel/label.
To have multiple Panels/Labels with different colours.I've created functions which update the required variables depending on which Panel/Label is selected (via buttons).
In
OnInit
I tried calling the functions in aninline function onControl
but it does not allow me to run a function... ??
So I tried calling the functions inonControl
using switch/case but although it compiles , it does not work.Cant manage to get my head round where I'm going wrong...
Could someone help a poor guy out?
Thanks!HiseSnippet 2979.3oc4Z0sbaabEFTRvVjIJMIimo8hbABa6LTSRjIg9wwgMiIEonsZjr4HpX6LY7nBArhDiAwhAXo9odzL9x9Jz65M8hlq5ifeG5KPdDxSPcOmcWPr.jTjRQw0tk1Fl6YOmc+N+rGbN.rcH0lDEQC0xke+yBHZ4de8Nm4y50nmkqu11M0xcC8lj9TsMOKvJJh3nkK272GmKW9Ez3e9o6sokmkuMIgjl1iot1jcb66xRn9mp8MtddsrbH661Wg60pssM0uA0iN.vw75k0BrretUWxCsP1lSG.wVNtLZXGlEiDokagMoNm0oG8DeA+O1Mx8POBNnhVGXgDjaQ8bPDiT0Zzy0yocr9FookSuch1OuP6uk9ttNtComXE9P9DFIRnZOxM2EAuJpvq7rCubJvaAA79H8N1gtArjYPr8qz2Ef419LR3QVfaPEZB90ly4CzaPAN7YqDQXOw0g0qzWtd4kqtTAE5Of31sGqz5k4Sf+Ijz0vsp3+sipJoXy8UFesw2+rpJD5vBc86xkDbnQLiisBM5P7H1LhyAss7IdfLw6WWBqAse.0GFTpHe1JEWtZ0wJ7NVGdABymUJ7su8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hGkyaSaQ8u.L+39x6TiCAO5IJSzysau3YbGdWLDcX6lTeuyjGqSqc2T7bYt.kKi.402EGar5kWj0t7hr9kWjMt7hbmKuHe4EIBVDd8ALZewMjABs2RjDK2vSK4lW6+fQI.ES
-
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.iINhJvOFu4bodMHlsnYgZJt7xyqTHY0Ym00qmAEZ7r6Qc7zUIFy1OO5dzN7vIbTNoZ0xre8y3AshwVd1OfsH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be9X9dxOB+aRmEnyt1MSKeCv7iiK6l2vDACqiEpnsdq1A0nG9IIQoCuePVlF87mYGW6tJ+hzMBkKQCRKuEVVYwydSV5r2jkO6MYkydSt4YuI2ZTMAQkVtqmUG9Zx.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.ABChPiquzDtWUtrEngo27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SewKnoeAM8KnoeAM8Knom3tbOGoouhHQy4tfl9Hoo+1HmqCQ0wZOU9ekUXl2TLI.bLYA5oj8c9A+YcIma9bRc.hG6opxAMjrF7Gen1d1DGncdrcHwW40A9hCInD51BKtGeLeO4Gg+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..