lemur - sysex receive

Discuss Lemur and share techniques.
dbk
Regular
Posts: 98
Joined: 14 Dec 2011 11:35

lemur - sysex receive

Post by dbk »

hello,

sorry for asking that much but i'm super stoked about the lemur and it's capabilites.
the controller for the MD comes along really well, however, i need again the help of you guys.

meanwhile i can send sysex just fine and switch pattern, load kits and so forth, very cool.

the problem now is the sysex receive, i learned that i need a script "on midi" which then listens to the incoming sysex message but i have no clue on how to decode the incoming messages.

i did not find a template, where i could had have a look at how this is done.

seems to be tricky thing :)

please help me out again.


thanks a lot,
martin
mbncp
Regular
Posts: 87
Joined: 08 Dec 2011 07:25

Re: lemur - sysex receive

Post by mbncp »

Yes, create a new script, call it OnSysex or whatever and select F0 System exclusive from the drop list, MIDI 0, and the rest is ignored

You can just add this to your script:

Monitor.value = MIDI_ARGS; // given you have a monitor object

if your sysex msg isn't too big you'll notice that you are receiving an array filled of values (0-127) where the status 0xF0 (240) is missing (bad decision imo) but the end of sysex 0xF7 (247) is present.

To send back that message I think you have to do it this way:
midiout(0, {0xF0, MIDI_ARGS}); // to include the sysex status byte

And you can then access any byte like on any array : if(MIDI_ARGS[0] == .....
for(n =0; n < sizeof(MIDI_ARGS); n++) { .... }
kraftf
Regular
Posts: 124
Joined: 14 Dec 2011 06:36

Re: lemur - sysex receive

Post by kraftf »

mbncp wrote:Yes, create a new script, call it OnSysex or whatever and select F0 System exclusive from the drop list, MIDI 0, and the rest is ignored

You can just add this to your script:

Monitor.value = MIDI_ARGS; // given you have a monitor object

if your sysex msg isn't too big you'll notice that you are receiving an array filled of values (0-127) where the status 0xF0 (240) is missing (bad decision imo) but the end of sysex 0xF7 (247) is present.

To send back that message I think you have to do it this way:
midiout(0, {0xF0, MIDI_ARGS}); // to include the sysex status byte

And you can then access any byte like on any array : if(MIDI_ARGS[0] == .....
for(n =0; n < sizeof(MIDI_ARGS); n++) { .... }
The stuff that you are explaining so well are missing from the manual!!
You have to be a fortune teller to figure them out.
Macciza
Regular
Posts: 1315
Joined: 07 Dec 2011 04:57
Location: Sydney, Australia.

Re: lemur - sysex receive

Post by Macciza »

Hi
Although there may not be specific examples of everything the info is there although some prior programming experience certainly helps . . .
The script you create executes on receipt of sysex messages on a particular channel and hands you an array called MIDI_ARGS containing the data.
What you do with it is up to you - and the same thing can be achieved in many different ways as well
You will also need to delve into the sysex documentation of whatever you wish to talk to as well
There is usually a difference between the message sent as a request to a device and the response given by it so it is not just a case of sending back the same message.

Some good programming tips to keep in mind are stuff like sizeof(a) which can help you check that you have the message you want by length,
and subarray(array,start,length) which is good for comparissions and separating out smaller parts of messages and
arraytostring(array[]) which can translate ascii numbers to charsto get patchnames and the like

If you don't having any coding experience I can see how it would all look very foreign, you are learning a new language
Go through as much code as you can and try to work out how it does some of what it does . . .

Cheers
MM
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]
dbk
Regular
Posts: 98
Joined: 14 Dec 2011 11:35

Re: lemur - sysex receive

Post by dbk »

@mbnpc: thanks a lot, your explanation helped me a big deal.

i'm able to receive sysex and could finish an essential part of the editor now.

@macizza: arraytostring might exactly be what i'm looking for right now :)

merry christmas,
martin
kraftf
Regular
Posts: 124
Joined: 14 Dec 2011 06:36

Re: lemur - sysex receive

Post by kraftf »

Macciza wrote:Hi
Although there may not be specific examples of everything the info is there although some prior programming experience certainly helps . . .
I agree very much with you that a programming experience is needed to feel more comfortable with the whole package.
This forum should have been a place where we could exchange info on programming techniques and this is done in a great extent where people like you and mbnmc(don't remember the name exactly) are being so kind to offer their experience.
However I shouldn't have to be forced to look for the definition of the MIDI_ARGS in this forum.
This should have been described inside the manual. The MIDI_ARGS and not only this, is part of Lemur language which is not documented at all inside the manual. Even if you have programming experience you aren't able to figure this out at first. Only through trial and error.
I am not new to programming(although its been a long time since I seriously programmed something) I am not knew to midi and seriously I didn't have the faintest idea what the MIDI_ARGS represents.
Serious flaws in the manual which from a small exploration of the Mutant forum have been already expressed from other users in the past.
In my opinion this is what guys from Liine should pay attention at if they want to make Lemur for iPad really popular and give new life to it.
nick_liine
Liine Staff
Posts: 285
Joined: 01 Oct 2010 11:06

Re: lemur - sysex receive

Post by nick_liine »

kraftf wrote:I agree very much with you that a programming experience is needed to feel more comfortable with the whole package.
This forum should have been a place where we could exchange info on programming techniques and this is done in a great extent where people like you and mbnmc(don't remember the name exactly) are being so kind to offer their experience.
However I shouldn't have to be forced to look for the definition of the MIDI_ARGS in this forum.
This should have been described inside the manual. The MIDI_ARGS and not only this, is part of Lemur language which is not documented at all inside the manual. Even if you have programming experience you aren't able to figure this out at first. Only through trial and error.
I am not new to programming(although its been a long time since I seriously programmed something) I am not knew to midi and seriously I didn't have the faintest idea what the MIDI_ARGS represents.
Serious flaws in the manual which from a small exploration of the Mutant forum have been already expressed from other users in the past.
In my opinion this is what guys from Liine should pay attention at if they want to make Lemur for iPad really popular and give new life to it.
Hi,

Thanks for your concern, suggestions for improvement are always welcome. Indeed, MIDI_ARGS was no more than mentioned in passing in the current version of the manual. I've already updated it to explain MIDI_ARGS and OSC_ARGS a little bit more. Will be uploading the revised manual soon.

Best regards,
Nick
Macciza
Regular
Posts: 1315
Joined: 07 Dec 2011 04:57
Location: Sydney, Australia.

Re: lemur - sysex receive

Post by Macciza »

Hi
Whilst I do agree that the manual needs some improvement, the best direction for these improvements depends on an individuals experience.
I believe there is more to be gained from learning general programming theory, designs, approach etc than just learning isolated examples.
I think i would like to see a very technical Reference manual documenting all features fully and accurately - an SDK style factual document.
Along with this could go a Programming Guide giving examples of syntax, design paradigms, simple/complex & local/global solutions.
Specific tutorials dealing with specific topics and various possible solution approaches discussed and/or worked through and evaluated.

I believe people will gain more through learning more general programming knowledge then by simply being given single, simple solutions.
This knowledge also leads one to be able to extrapolate 'design principles' form examples so that can be applied elsewhere more easily.

I hope that this sort of information resource will gradually become available as the community grows . . .

Cheers
MM
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]
kraftf
Regular
Posts: 124
Joined: 14 Dec 2011 06:36

Re: lemur - sysex receive

Post by kraftf »

Macciza wrote:Hi
Whilst I do agree that the manual needs some improvement, the best direction for these improvements depends on an individuals experience.
I believe there is more to be gained from learning general programming theory, designs, approach etc than just learning isolated examples.
I think i would like to see a very technical Reference manual documenting all features fully and accurately - an SDK style factual document.
Along with this could go a Programming Guide giving examples of syntax, design paradigms, simple/complex & local/global solutions.
Specific tutorials dealing with specific topics and various possible solution approaches discussed and/or worked through and evaluated.

I believe people will gain more through learning more general programming knowledge then by simply being given single, simple solutions.
This knowledge also leads one to be able to extrapolate 'design principles' form examples so that can be applied elsewhere more easily.

I hope that this sort of information resource will gradually become available as the community grows . . .

Cheers
MM
I very much agree with you.
However all the above that you are suggesting is directed to a specific range of people that have the background and are able to develop their skills regarding this language or they will be able in the future after gaining some experience. Certainly it will not be for everybody in the first place.
But regarding people that have limited programming skills, they should be able to accomplish simple stuff more quickly. I think simple projects/examples are missing and people have to go through more comlex setups/examples resulting in a very steep learning curve.
For example there is no example of how to route a midi input to a midi output.This is something that I've made and as a newbie it took me way more time to accomplish this than it should.
In time that I will be improving my programming skills I will be able to build transformer objects for handling midi data. But the midi routing setup should have been already there, without me trying to setup it without knowing what MIDI_ARGS mean.

@nick_liine
Thanks a lot for taking into account my suggestions. Be sure that my intentions are pure and I have to say that I've become a big fun of this product and although it has let me down quite a few times I know eventually it will be more than rewarding. Actually it already is!! :)
bammer
Newbie
Posts: 11
Joined: 27 Dec 2011 20:57

Re: lemur - sysex receive

Post by bammer »

mbncp wrote:Yes, create a new script, call it OnSysex or whatever and select F0 System exclusive from the drop list, MIDI 0, and the rest is ignored

You can just add this to your script:

Monitor.value = MIDI_ARGS; // given you have a monitor object

if your sysex msg isn't too big you'll notice that you are receiving an array filled of values (0-127) where the status 0xF0 (240) is missing (bad decision imo) but the end of sysex 0xF7 (247) is present.
This is fantastic information.
Is there any function in Lemur that converts this array of received sysex data from decimal to hex in real time?
Post Reply