Switch behaviour - change MIDI CC of other object?

Discuss Lemur and share techniques.
Post Reply
db73
Newbie
Posts: 25
Joined: 14 Feb 2013 23:32

Switch behaviour - change MIDI CC of other object?

Post by db73 »

The parameter I'm trying to control (oscillator frequency) has a coarse and a fine mode with a different MIDI CC for each. I've assigned a switch to change between the different modes as you would on the synth. But when switched to 'fine' tuning the fader no longer operates the parameter. So I think I also need to make the switch change the MIDI CC value of the fader when activated. Is it possible to do this? Or would I need a separate fader for each mode (one for 'coarse' and one for 'fine' tuning). Cheers ;)
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Switch behaviour - change MIDI CC of other object?

Post by Softcore »

Due to the fact you cannot change the CC assignment of an object, the way to accomplish this is by using two seperate faders and show-hide each one via the switch and scripting.

add script in switch, on expression x, any

Code: Select all

show(fader1_name, x);
show(fader2_name, 1-x);
This will toggle the visibility of the two faders. of course set the CC mappings of each fader to your desired ones.
db73
Newbie
Posts: 25
Joined: 14 Feb 2013 23:32

Re: Switch behaviour - change MIDI CC of other object?

Post by db73 »

Softcore wrote:Due to the fact you cannot change the CC assignment of an object, the way to accomplish this is by using two seperate faders and show-hide each one via the switch and scripting.

add script in switch, on expression x, any

Code: Select all

show(fader1_name, x);
show(fader2_name, 1-x);
This will toggle the visibility of the two faders. of course set the CC mappings of each fader to your desired ones.
Thanks for the reply ;)

But does anyone know if these scripts work in the Lemur App or do I need to do this in the PC/Mac editor? It's just that whenever I try to add a script in the App I get a syntax error - text turns red and I can't then save the script. This happens as soon as I type 'show' and then add the '('. It doesn't seem to like the open bracket for starters :?
Joe Soap
Regular
Posts: 462
Joined: 07 Jul 2012 15:04

Re: Switch behaviour - change MIDI CC of other object?

Post by Joe Soap »

This happens as soon as I type 'show' and then add the '('. It doesn't seem to like the open bracket for starters :?
It didn't even like the "s".

You need to complete writing the script, it won't revert from red text until the whole thing is free of syntax-errors . . . which it necessarily will be (in an error-state) until complete.

As you've noticed, all scripts start out in error (red text).

Most of mine end up that way too! :lol:
db73
Newbie
Posts: 25
Joined: 14 Feb 2013 23:32

Re: Switch behaviour - change MIDI CC of other object?

Post by db73 »

..... Actually, ie just tried this in the Lemur Editor on PC and I can't seem to get it here either. Obviously I'm doing something wrong. New to this so learning from scratch as I go.

Actually on the subject of the Lemur Editor - is it possible to test your templates in the editor? Or do you have to move them over to your device? I did try setting up an Ad Hoc network on my PC but I wasn't able to do this. Not sure why but the option to create an Ad Hoc Network wasn't in the list of options I had.
Joe Soap
Regular
Posts: 462
Joined: 07 Jul 2012 15:04

Re: Switch behaviour - change MIDI CC of other object?

Post by Joe Soap »

I take it you're on Windows 8 then?

http://www.addictivetips.com/windows-ti ... windows-8/

. . . and if netsh tells you your hardware can support "hosted networks" (virtual networks) then you'll want this:

http://www.intel.com/content/www/us/en/ ... ology.html

^ Which might save you a few quid, since apps like Connectify are just a wrapper for the Intel code.

You can test your work up to a point in the Editor - hold down the "e" key on your computer keyboard and the Editor enters "Run Mode" where you can operate the template with the mouse. This works for checking internal consistency but I don't think it outputs any MIDI or OSC.

If It did . . . some of us would be using the Editor instead of the app! :mrgreen:
db73
Newbie
Posts: 25
Joined: 14 Feb 2013 23:32

Re: Switch behaviour - change MIDI CC of other object?

Post by db73 »

Joe Soap wrote:
This happens as soon as I type 'show' and then add the '('. It doesn't seem to like the open bracket for starters :?
It didn't even like the "s".

You need to complete writing the script, it won't revert from red text until the whole thing is free of syntax-errors . . . which it necessarily will be (in an error-state) until complete.

As you've noticed, all scripts start out in error (red text).
Fantastic! I entered the full script as you had posted and it worked this time :D Are the object names case sensitive? I think the first time I tried this I used 'fader' instead of 'Fader'. Anyway it works now and in the editor holding down the 'E' key confirms this. Awesome ;) ........ Now, how do I do this directly from then Lemur App? :? Can I do it there? Because I'm having trouble setting up an ad-hoc network that my iPad can connect to (it can see it but it just won't connect .... But that's a whole separate thing!)

Many thanks for your help. Much appreciated :D
db73
Newbie
Posts: 25
Joined: 14 Feb 2013 23:32

Re: Switch behaviour - change MIDI CC of other object?

Post by db73 »

..... Okay, I FINALLY manged to figure out how to enter the script in the actual editor .... And it turned black! Thought I'd cracked it ...... Except now when I operate the switch the script has been created on both fades remain visible! ARGGGGHHH!! :oops: Close, but no cigar ..... Not just yet anyway :?
db73
Newbie
Posts: 25
Joined: 14 Feb 2013 23:32

Re: Switch behaviour - change MIDI CC of other object?

Post by db73 »

....... Hold the friggin phone!! I've cracked it! :D All working on the iPod now. Fantastic ;)

Couldn't have done this without your help Joe Soap so many thanks for your assistance. I'm chuffed to bits I got the bloody thing working 8-)
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Switch behaviour - change MIDI CC of other object?

Post by Softcore »

YES they are case sensitive......

;)
Post Reply