Page 1 of 1

Display text Message by incoming Midi CC - Script question

Posted: 17 Sep 2012 09:27
by iceleben
Hello,
I've bought Lemur a week ago and so far I'm very impressed by the software, but I have a script question which is driving me nuts for the last days...
I'd like to display a text message when I receive a Midi CC when it reaches value 64. below that it should display nothing or another text.
I found a script where I can Monitor the incoming data and the setup so far is fine - the Midi value is displayed in the Monitor.
If you have any existing template with this function or if you could help me which commands are needed for the script, I'd be very thankful.

Cheers,
Markus

Re: Display text Message by incoming Midi CC - Script questi

Posted: 17 Sep 2012 22:41
by iceleben
I have finally made a partial working script/template (problem was the MIDI_ARGS[1]). It displays the words by incoming Midi Data but aside from the warning symbol next to the script I have the problem that if I pull it from my Library in another template it displays the Text in a completely different Text Field?????

If you know where the Bug is please feel free to help :D

Here is the script and attached the Template
decl val1 = MIDI_ARGS[1];
if(val1<=50)setattribute(Text,'content','Below');
if(val1>=51)setattribute(Text,'content','Above');

Re: Display text Message by incoming Midi CC - Script questi

Posted: 17 Sep 2012 22:51
by iceleben
Oh so stupid - of course it does - maybe its just to late - I should have renamed the textstring in the template to the just created textfieldnumber. So the only question that's left why the warning Symbol?

Re: Display text Message by incoming Midi CC - Script questi

Posted: 18 Sep 2012 13:25
by nick_liine
You could use the getobject() function to reference the current object. This is helpful to create "portable" scripts. For example in your code:

Code: Select all

decl val1 = MIDI_ARGS[1];
if(val1<=50)setattribute(getobject(),'content','Below');
if(val1>=51)setattribute(getobject(),'content','Above');
Cheers,
Nick

Re: Display text Message by incoming Midi CC - Script questi

Posted: 18 Sep 2012 13:30
by Macciza
Hmm
Ok that is a bit odd - will try to have a closer look
If you copy the script text then delete and recreate the script and past it back in it should work.
Sorry about that -
MM

Re: Display text Message by incoming Midi CC - Script questi

Posted: 18 Sep 2012 20:16
by iceleben
Thank you both for your input,will try this later as I'm working on a new template right now- the Idea with the getobject is great! What a Beast this App is - so great - and I've just scratched the surface. Hope to get finished until next Monday...