string to integer

Discuss problems and solutions.
Post Reply
gjschipper
Newbie
Posts:16
Joined:27 Jun 2014 07:38
string to integer

Post by gjschipper » 18 Nov 2014 20:41

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);
}

Macciza
Regular
Posts:1325
Joined:07 Dec 2011 04:57
Location:Sydney, Australia.

Re: string to integer

Post by Macciza » 19 Nov 2014 05:13

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
iMac 2.8G i7 12G 10.6.8/10.7.2, Legacy Dexter/Lemur, Liine Lemur/iPad2, KMI SoftStep, 12Step & QuNeo , B-Controls, Mackie C4 etc
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]

gjschipper
Newbie
Posts:16
Joined:27 Jun 2014 07:38

Re: string to integer

Post by gjschipper » 19 Nov 2014 15:20

Yes, it's sysex.

Post Reply