Hi, new here. Building my first project at the moment.
-
- Newbie
- Posts: 3
- Joined: 18 Mar 2015 20:25
Hi, new here. Building my first project at the moment.
Been learning how to use Lemur for a couple of days now. My first project is a controller for the Pigtronix Inifinity Looper midi input. Working well so far, but I could definitely use some help with scripting.
I've added a pad button to a fader acting as a momentary on/off switch. Right now I have two scripts running in that pad, one where x=0 executeas leaving zero, and one where x=0.5 executes reaching zero. That works well as a momentary on/off switch, but it always returns to a fixed value. Can I set it so the fader returns to the original value set before I've engaged the pad?
I've added a pad button to a fader acting as a momentary on/off switch. Right now I have two scripts running in that pad, one where x=0 executeas leaving zero, and one where x=0.5 executes reaching zero. That works well as a momentary on/off switch, but it always returns to a fixed value. Can I set it so the fader returns to the original value set before I've engaged the pad?
Re: Hi, new here. Building my first project at the moment.
yes, you can do this with an expression to save the last value.
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro
-
- Newbie
- Posts: 3
- Joined: 18 Mar 2015 20:25
Re: Hi, new here. Building my first project at the moment.
Great! How would that look? I'm still getting the hang of how expressions and scripts work together.
Re: Hi, new here. Building my first project at the moment.
Check out the scripts in both Pad and Fader object!
- Attachments
-
- checkThisOut.jzml
- (5.08 KiB) Downloaded 60 times
-
- Newbie
- Posts: 3
- Joined: 18 Mar 2015 20:25
Re: Hi, new here. Building my first project at the moment.
Thank you, that's exactly what I needed! Makes sense now.
Re: Hi, new here. Building my first project at the moment.
I'm still getting the hang of how expressions and scripts work together.???
Re: Hi, new here. Building my first project at the moment.
Expressions are just "variables" you "create" and name as you want (either inside objects or globally).
The whole thing then, with scripts is that you make them "execute" when something happens to an expresion - for example to make a script execute when a button is pressed, you create a script : on Expression, x, any
Then inside the scripts you are free to do what you want with your own expressions in a logic - mathematical form so that you can get the result you are after. Thats the philosophy in a nutshell - so to answer your question, scripts work together with expressions in the ways YOU want - how you instruct them to do so, inside the scripts.
The whole thing then, with scripts is that you make them "execute" when something happens to an expresion - for example to make a script execute when a button is pressed, you create a script : on Expression, x, any
Then inside the scripts you are free to do what you want with your own expressions in a logic - mathematical form so that you can get the result you are after. Thats the philosophy in a nutshell - so to answer your question, scripts work together with expressions in the ways YOU want - how you instruct them to do so, inside the scripts.
Re: Hi, new here. Building my first project at the moment.
Lets look at the example above.
Inside the "pad" object we create an expression we call "last". We leave it blank, that is we dont give it any discreet value (we could if we wanted).
Then we have used a script which we named "setlast" because thats what we plan to do with it - "store" the last value of our fader in the expression "last".
Lets analyze this bit though - what do we mean, when we say "save the last fader value".
The LAST fader value is whatever value the fader has, WHEN WE LET IT GO (untouch).
A haaaaa, bright moment: the z variable of objects goes 1 when we touch them, 0 when we let them go.
So....... if we can have way to "store" the fader's value WHEN we let it go....then THAT value is the "last" value we want the fader to return to, when we let go of that "pad".
Easy then, the script we created "setlast" needs to be "executed" when we let go of the fader, that is
on expression z, falling to zero (down arrow)
Having done that, we then go to our pad.
Now all we have to do, is instruct the pad to get the fader to 0 when we press it, then make the fader return to the last value when we let it go.
Thus we end up with the script setfader which resides inside the pad button - remember the x of a Pad object is 1 when the pad is pressed, 0 when the pad is released.
on expression x, any
means: if Pad.x is anything but 0 (if the Pad is pressed), get the fader down to zero
means: else (if Pad.x is zero, if Pad is released) go get the value stored inside Fader object named "last" and make the fader go to THAT value. But that value was set the LAST time we let go of the fader, due to our first script, "setlast".
Inside the "pad" object we create an expression we call "last". We leave it blank, that is we dont give it any discreet value (we could if we wanted).
Then we have used a script which we named "setlast" because thats what we plan to do with it - "store" the last value of our fader in the expression "last".
Lets analyze this bit though - what do we mean, when we say "save the last fader value".
The LAST fader value is whatever value the fader has, WHEN WE LET IT GO (untouch).
A haaaaa, bright moment: the z variable of objects goes 1 when we touch them, 0 when we let them go.
So....... if we can have way to "store" the fader's value WHEN we let it go....then THAT value is the "last" value we want the fader to return to, when we let go of that "pad".
Easy then, the script we created "setlast" needs to be "executed" when we let go of the fader, that is
on expression z, falling to zero (down arrow)
Code: Select all
last=x;
Now all we have to do, is instruct the pad to get the fader to 0 when we press it, then make the fader return to the last value when we let it go.
Thus we end up with the script setfader which resides inside the pad button - remember the x of a Pad object is 1 when the pad is pressed, 0 when the pad is released.
on expression x, any
Code: Select all
if (x) Fader.x=0;
Code: Select all
else Fader.x=Fader.last;
Re: Hi, new here. Building my first project at the moment.
Inside the "pad" object we create an expression we call "last". We leave it blank, that is we dont give it any discreet value (we could if we wanted).
Then we have used a script which we named "setlast" because thats what we plan to do with it - "store" the last value of our fader in the expression "last".
Lets analyze this bit though - what do we mean, when we say "save the last fader value".
The LAST fader value is whatever value the fader has, WHEN WE LET IT GO (untouch).
Then we have used a script which we named "setlast" because thats what we plan to do with it - "store" the last value of our fader in the expression "last".
Lets analyze this bit though - what do we mean, when we say "save the last fader value".
The LAST fader value is whatever value the fader has, WHEN WE LET IT GO (untouch).