Change Slider Value via MIDI + Velocity
-
@d-healey Any else statement I do like this.
function onNoteOff() { if (keySwitchesC.contains(Message.getNoteNumber())) { slider.setValue(index); slider1.setValue(index); else slider.setValue(Message.getVelocity()); slider1.setValue(Message.getVelocity()); } }
I get the error:
! Line 8, column 2: Found 'else' when expecting a statement
-
@trillbilly I just had a similar conversation with another forum member a few minutes ago :)
Code is written in blocks. Blocks are defined by opening and closing curly braces
{}
Your
if
statement is a block, and so requires{}
if (something) { }
Your else is also a block, so it also needs curly braces.
else { }
-
@d-healey ahhhh, yes. Now I see.
Im confusing myself on the order I should be doing this in.
*Example:
If slider changes valueelse
these slider stay same value*
Im confused which way I call for the slider in the IF statement. Do I call just the slider or do I call the "cKeySwitch" Variable or "cAnimation" Function. I've tried them all and cant seem to figure it out. The animation compiles and still works but the issue is not fixed,
-
@trillbilly Write it out as a list, in English.
Do this,
Then do this,
If this, do this,
Otherwise do this
etc.
etc.It might make it easier to figure out the flow of the program.