I’m struggling with the syntax for local variables (if they exist) in expressions in the Controller Bar. Local variables exist in SysEx expressions, but I can figure them out (or find info) for expressions in the Controller Bar.
I’m trying to display the currently played Note Name in the Controller bar. I have the MIDI value coming in on $cc(32,16) and want to convert it to text - Note name + octave. I currently have:
$(cc(32,16)-(cc(32,16)/12)*12==0?"C":cc(32,16)-(cc(32,16)/12)*12==1?"C#":cc(32,16)-(cc(32,16)/12)*12==2?"D":cc(32,16)-(cc(32,16)/12)*12==3?"D#":cc(32,16)-(cc(32,16)/12)*12==4?"E":cc(32,16)-(cc(32,16)/12)*12==5?"F":cc(32,16)-(cc(32,16)/12)*12==6?"F#":cc(32,16)-(cc(32,16)/12)*12==7?"G":cc(32,16)-(cc(32,16)/12)*12==8?"G#":cc(32,16)-(cc(32,16)/12)*12==9?"A":cc(32,16)-(cc(32,16)/12)*12==10?"A#":cc(32,16)-(cc(32,16)/12)*12==11?"B":"X") $((cc(32,16)/12)-1)$("\n")$(cc(32,16))
… which would be a lot simpler if I could assign something like:
var n = cc(32,16)-(cc(32,16)/12)*12
and then (somehow) reference n as a variable.
Is there a way to do this?
BTW, I found no remainder (%) operator, and the various choices for remainder functions are not great - IEEERemainder() returns negative numbers half the time …
If you are curious why I would need to know the note I am playing - I set my Sylphyo to different keys depending on the key of the song, and then it gets transposed on some songs by MIDI Filters on various paths. When somebody asks me “what note are you playing” I have no idea (in concert pitch) what it is!