Troubleshooting

string to integer

Started by gjschipper on .

Sign in or create an account to join the conversation.

3 posts

Topic starter
How to convert a string to integer.

This is my script:

decl id = 0;
if (MIDI_ARGS[2] == 127)
{
strLCD128 = arraytostring(MIDI_ARGS[5]);
id = Integer.parseInt(strLCD128); ??????
selectinterface(id);
}
Hi
What makes you think you are sending a string?
And what are you actually sending? Sysex? What is your MIDI_ARGS[5]?

Using CCs and the midi channel as the selector, in an OnMidi script setup for CCs on all channels the script would be
selectinterface(MIDI_ARGS[2]);

The channel is a number so no need for any conversion . . .
Cheers