How to switch scripts on and off
How to switch scripts on and off
Is there a way to switch scripts on and off with buttons? I did read the manual...
Last edited by jbgeluid on 07 Oct 2012 11:53, edited 1 time in total.
Cubase 11, Windows 10/
Intel I7 4930K @3.4Ghz/
multiple RME hammerfall cards
Controllers: Ipad2/16gb, Lemur, BCR2000
http://www.jbgeluid.nl
Intel I7 4930K @3.4Ghz/
multiple RME hammerfall cards
Controllers: Ipad2/16gb, Lemur, BCR2000
http://www.jbgeluid.nl
Re: Switch scripts on and off
You could create a variable called run_script or something, and start those scripts with:
Then just set run_script to 1 when you want it to run, and 0 otherwise.
Code: Select all
if(!run_script) return;
Re: How to switch scripts on and off
brianc,
thanks for your reply, but can you be more specific? I'm a beginner, sorry..
thanks for your reply, but can you be more specific? I'm a beginner, sorry..
Cubase 11, Windows 10/
Intel I7 4930K @3.4Ghz/
multiple RME hammerfall cards
Controllers: Ipad2/16gb, Lemur, BCR2000
http://www.jbgeluid.nl
Intel I7 4930K @3.4Ghz/
multiple RME hammerfall cards
Controllers: Ipad2/16gb, Lemur, BCR2000
http://www.jbgeluid.nl
Re: How to switch scripts on and off
Hi
Brianc has shown a way for scripts to only run if the run_script variable is set - say by a switch
This lets you have a script for say an object that will only run when the flag is set - say by using a Switch or set from another script
If you mean run a script in response to a switch set the script up to execute On Expression and Switch.x (or whatever) to use your switch to run it . .
Cheers
MM
Brianc has shown a way for scripts to only run if the run_script variable is set - say by a switch
This lets you have a script for say an object that will only run when the flag is set - say by using a Switch or set from another script
If you mean run a script in response to a switch set the script up to execute On Expression and Switch.x (or whatever) to use your switch to run it . .
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]
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]
Re: How to switch scripts on and off
Sure, here's an example template that (I hope) demonstrates how this can be done.jbgeluid wrote:brianc,
thanks for your reply, but can you be more specific? I'm a beginner, sorry..
- Attachments
-
- script_onoff.jzml
- (3.74 KiB) Downloaded 170 times
Re: How to switch scripts on and off
excellent. So simple.
Now, what if you don't have a switch as 'trigger', but a Knob object? A Fader object has a 'touch'-variable z, but the Knob object not. Is it possible to fake a z variable with a Knob object? For example, when Knob.x increases or decreases? How to you express that? Or is there a simpler method?
The code is wrong, but you probably understand what it should do. If Knob.x changes, return (don't continue with the script). If Knob.x remains the same, continue with the script.
Now, what if you don't have a switch as 'trigger', but a Knob object? A Fader object has a 'touch'-variable z, but the Knob object not. Is it possible to fake a z variable with a Knob object? For example, when Knob.x increases or decreases? How to you express that? Or is there a simpler method?
Code: Select all
if (Knob.x ++) return;
if (Knob.x --) return;
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro
Re: How to switch scripts on and off
It's a little ugly, but I guess my approach would be to have a script that runs whenever Knob.x changes that updates a variable that stores the time at which the value was last changed. So something like:Phil999 wrote:Now, what if you don't have a switch as 'trigger', but a Knob object? A Fader object has a 'touch'-variable z, but the Knob object not. Is it possible to fake a z variable with a Knob object? For example, when Knob.x increases or decreases? How to you express that? Or is there a simpler method?
Code: Select all
last_change = time;
Code: Select all
if(time - Knob.last_change > 2) return;
Re: How to switch scripts on and off
good idea. I tried it out, it doesn't work yet, but using a variable, and an expression-x-script for the 'trigger'-knob is a good method.
I also tried a variable (touch) and two scripts (touch_on, touch_off), but this also didn't work yet.
It shouldn't be too difficult, I'll get it soon I guess. Thank you for your help, very appreciated.
I also tried a variable (touch) and two scripts (touch_on, touch_off), but this also didn't work yet.
It shouldn't be too difficult, I'll get it soon I guess. Thank you for your help, very appreciated.
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro
Re: How to switch scripts on and off
Thanks Brianc and Phil999 for your input! This realy helps.
Jurgen
Jurgen
Cubase 11, Windows 10/
Intel I7 4930K @3.4Ghz/
multiple RME hammerfall cards
Controllers: Ipad2/16gb, Lemur, BCR2000
http://www.jbgeluid.nl
Intel I7 4930K @3.4Ghz/
multiple RME hammerfall cards
Controllers: Ipad2/16gb, Lemur, BCR2000
http://www.jbgeluid.nl
Re: How to switch scripts on and off
I want to disable the script when the knob changes, so it'sbrianc wrote:Which will disable that script if the knob hasn't been changed in the last 2 seconds. With a really small threshold, you can have this be sensitive to within a few milliseconds.Code: Select all
if(time - Knob.last_change > 2) return;
Code: Select all
if(time - Knob.last_change < 2) return;
Unfortunately, the script I want to prevent being executed does receive MIDI and moves the 'trigger'-knob - I'm running again in a feedback loop, something I wanted to prevent in the first place. My fault, I didn't expect that. I have to rethink this matter ...
Thanks again, your method is working.
My problem is described here:
http://liine.net/forum/viewtopic.php?f=25&t=1732
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro