I'm trying to have an automatically beat aware fx with script,but I'm foggy with what I can do with variables
What I need is to compare startBeat to nowBeat and if the difference => 8 stop the repeat script and stop the fx
How do I compare 2 variables (can I do it at all?)
or should I compare startBeat (+8) to the param get_beatpos?
This is what I have so far
effect_active "echo" 1 & get_beatpos & param_add 8 & param_cast & set "startBeat" & repeat_start_instant "beatWatch" 33ms & get_beatpos & param_cast & set "nowBeat" & (somehow compare vars, =>) ? repeat_stop "beatWatch" & effect_active "echo" 0 : nothing
What I need is to compare startBeat to nowBeat and if the difference => 8 stop the repeat script and stop the fx
How do I compare 2 variables (can I do it at all?)
or should I compare startBeat (+8) to the param get_beatpos?
This is what I have so far
effect_active "echo" 1 & get_beatpos & param_add 8 & param_cast & set "startBeat" & repeat_start_instant "beatWatch" 33ms & get_beatpos & param_cast & set "nowBeat" & (somehow compare vars, =>) ? repeat_stop "beatWatch" & effect_active "echo" 0 : nothing
Posted Thu 15 Oct 15 @ 10:40 am
param_bigger can be used for that.
It can accept 2 actions as parameters, so you can have
param_bigger "get_var 'var1'" "get_var 'var2'" ? this : that
It can accept 2 actions as parameters, so you can have
param_bigger "get_var 'var1'" "get_var 'var2'" ? this : that
Posted Thu 15 Oct 15 @ 11:38 am
Thanks for that, I forget that vars can be called as params with "get"
Posted Thu 15 Oct 15 @ 11:41 am
There's a problem here, I think
get_beatpos & param_cast & set 'nowBeat' & get_beatpos & param_add 8 & param_cast & set "startBeat"
works, but adding repeat_start into the equation and it doesn't work out
get_beatpos & param_cast & set 'nowBeat' & get_beatpos & param_add 8 & param_cast & set "startBeat" & repeat_start_instant "name" 33ms & get_beatpos & param_cast & set 'nowBeat'
have a try to script the original idea and tell me if it's a bug or user error.
get_beatpos & param_cast & set 'nowBeat' & get_beatpos & param_add 8 & param_cast & set "startBeat"
works, but adding repeat_start into the equation and it doesn't work out
get_beatpos & param_cast & set 'nowBeat' & get_beatpos & param_add 8 & param_cast & set "startBeat" & repeat_start_instant "name" 33ms & get_beatpos & param_cast & set 'nowBeat'
have a try to script the original idea and tell me if it's a bug or user error.
Posted Thu 15 Oct 15 @ 12:45 pm
It's a bit complicated why the script isn't working like you wrote it, but an easier way to write it is:
get_beatpos & param_cast & set 'nowBeat' & get_beatpos & param_add 8 & param_cast & set "startBeat" & repeat_start_instant "name" 33ms -1 0 & set 'nowBeat' '`get_beatpos'
get_beatpos & param_cast & set 'nowBeat' & get_beatpos & param_add 8 & param_cast & set "startBeat" & repeat_start_instant "name" 33ms -1 0 & set 'nowBeat' '`get_beatpos'
Posted Thu 15 Oct 15 @ 1:22 pm
Thanks that works, -1 for infinite repeats, Zero for ?
For anyone wanting this here's an example with echo for 8 beats, change "param_add 8" to whatever length you want.
effect_active "echo" & get_beatpos & param_cast & set 'nowBeat' & get_beatpos & param_add 8 & param_cast & set "startBeat" & repeat_start_instant "rsiBeatWatch" 33ms -1 0 & set 'nowBeat' '`get_beatpos' & param_smaller "get_var 'startBeat'" "get_var 'nowBeat'" ? nothing : repeat_stop "rsiBeatWatch" & effect_active "echo"
For anyone wanting this here's an example with echo for 8 beats, change "param_add 8" to whatever length you want.
effect_active "echo" & get_beatpos & param_cast & set 'nowBeat' & get_beatpos & param_add 8 & param_cast & set "startBeat" & repeat_start_instant "rsiBeatWatch" 33ms -1 0 & set 'nowBeat' '`get_beatpos' & param_smaller "get_var 'startBeat'" "get_var 'nowBeat'" ? nothing : repeat_stop "rsiBeatWatch" & effect_active "echo"
Posted Thu 15 Oct 15 @ 1:49 pm
I don't think the -1 and 0 are necessary actually, was just testing while trying to get the original script to work.
Posted Fri 16 Oct 15 @ 5:35 am
Another one, I'd like to change this
slip on & loop 0.5 & repeat 235ms & down ? key 0 ? key -1 : key -1 ? key -2 : key -2 ? key -3 : key -4 : loop 0 & key 0 & slip off
from a static (preset bpm) press and hold, to a dynamic single press, I've got ideas to use similar to above but of course being in a loop means it won't work the same. So I've ideas to query the in loop pos, but if I could query the slip position it'd be less brain ache.
Can I query the slip position?
slip on & loop 0.5 & repeat 235ms & down ? key 0 ? key -1 : key -1 ? key -2 : key -2 ? key -3 : key -4 : loop 0 & key 0 & slip off
from a static (preset bpm) press and hold, to a dynamic single press, I've got ideas to use similar to above but of course being in a loop means it won't work the same. So I've ideas to query the in loop pos, but if I could query the slip position it'd be less brain ache.
Can I query the slip position?
Posted Tue 27 Oct 15 @ 2:27 pm