Page 1 of 1

string to integer

Posted: 18 Nov 2014 20:41
by gjschipper
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);
}

Re: string to integer

Posted: 19 Nov 2014 05:13
by Macciza
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

Re: string to integer

Posted: 19 Nov 2014 15:20
by gjschipper
Yes, it's sysex.