Hi,
At the beginning I would like to apologize if this is not proper section in this forum for this kind of question, but couldn't find anything dedicated. Please let me know if there is any specific topic for that.
I am struggling with some issue in VDJ scripting in one part of my code that I couldn't figure out, so maybe here there is someone who could help me.
Long story short: The code below that I wrote places one cue point 701 on actual beat grid position once button is pressed and cue point 702 once button is released at the position where it was released. It works perfectly.
The next step which I would like to achieve is to quantize those cues placement with precision of 1 beat. Once I added param_cast 'integer' for get_beatpos which rounds previous parameter to the nearest integer for cue 702 as shown below - everything still works as expected - it means, cue 701 is placed once button is pressed at the place where button is pressed, and 702 is placed once button is released and at the place where it is released, but its position is quantized to the nearest whole beat.
However once I do the same for cue 701 (code below) there is some unexpected effect, namely once I press button, cue 701 is quantized and placed at the nearest whole beat (correct), however cue 702 is quantize and placed at the same beat as cue 701 despite the button is release a few beats further.
I tried to tackle this issue in many ways, but with no success. I would really appreciate any help here.
Thank you in advance!
At the beginning I would like to apologize if this is not proper section in this forum for this kind of question, but couldn't find anything dedicated. Please let me know if there is any specific topic for that.
I am struggling with some issue in VDJ scripting in one part of my code that I couldn't figure out, so maybe here there is someone who could help me.
Long story short: The code below that I wrote places one cue point 701 on actual beat grid position once button is pressed and cue point 702 once button is released at the position where it was released. It works perfectly.
get_beatpos & set_cue 701 & play & repeat_start_instant 'repeat1' 1ms 10000 & pad_pushed 7 ?
nothing : get_beatpos & & set_cue 702 & repeat_stop 'repeat1'
The next step which I would like to achieve is to quantize those cues placement with precision of 1 beat. Once I added param_cast 'integer' for get_beatpos which rounds previous parameter to the nearest integer for cue 702 as shown below - everything still works as expected - it means, cue 701 is placed once button is pressed at the place where button is pressed, and 702 is placed once button is released and at the place where it is released, but its position is quantized to the nearest whole beat.
get_beatpos & set_cue 701 & play & repeat_start_instant 'repeat1' 1ms 10000 & pad_pushed 7 ?
nothing : get_beatpos & param_cast 'integer' & set_cue 702 & repeat_stop 'repeat1'
However once I do the same for cue 701 (code below) there is some unexpected effect, namely once I press button, cue 701 is quantized and placed at the nearest whole beat (correct), however cue 702 is quantize and placed at the same beat as cue 701 despite the button is release a few beats further.
get_beatpos & param_cast 'integer' & set_cue 701 & play & repeat_start_instant 'repeat1' 1ms 10000 & pad_pushed 7 ?
nothing : get_beatpos & param_cast 'integer' & set_cue 702 & repeat_stop 'repeat1'
I tried to tackle this issue in many ways, but with no success. I would really appreciate any help here.
Thank you in advance!
Mensajes Tue 14 Jan 25 @ 9:44 pm
If you have the setting global quantize on 1 beat and quantize set cue to true, could you do this?
You could probably also get the current global quantize setting, set it to 1 beat, do this operation, then restore the original global quantize setting if you want to keep it a certain way.
down ? set_cue 701 : set_cue 702
You could probably also get the current global quantize setting, set it to 1 beat, do this operation, then restore the original global quantize setting if you want to keep it a certain way.
Mensajes Tue 14 Jan 25 @ 10:10 pm
you should do this really, a rsi isn't needed
To fix your example, I believe you've run into an implicit with your first set_cue, wrapping that section in brackets fixes it
Also rsi's only run reliably at ~33ms
play & down ? get_beatpos & param_cast 'integer' & set_cue 701 : get_beatpos & param_cast 'integer' & set_cue 702
To fix your example, I believe you've run into an implicit with your first set_cue, wrapping that section in brackets fixes it
( get_beatpos & param_cast 'integer' & set_cue 701 ) & play & repeat_start_instant 'repeat1' 33ms 10000 & pad_pushed 7 ? nothing : get_beatpos & param_cast 'integer' & set_cue 702 & repeat_stop 'repeat1'
Also rsi's only run reliably at ~33ms
Mensajes Tue 14 Jan 25 @ 10:19 pm
Thank you for a quick answer!
I forgot to mention, but unfortunately I cannot use global quantize setting - explaining why:
I pasted above simplified code, where I quantize it just to one beat, but in practice I quantize and use some offset e.g. 0.007 beat for button 7 (param_add 0.007) to avoid cue points overlapping from other buttons (each button has own unique offset). If you have more than one cue point at the same place, the cue action is executed only from the first one - that's VDJ limitation that I observed). If I use global quantize setting I cannot apply any offset to cue point as offset is also quantized. That's why I'm forced to use param_cast 'integer' for that purpose.
I forgot to mention, but unfortunately I cannot use global quantize setting - explaining why:
I pasted above simplified code, where I quantize it just to one beat, but in practice I quantize and use some offset e.g. 0.007 beat for button 7 (param_add 0.007) to avoid cue points overlapping from other buttons (each button has own unique offset). If you have more than one cue point at the same place, the cue action is executed only from the first one - that's VDJ limitation that I observed). If I use global quantize setting I cannot apply any offset to cue point as offset is also quantized. That's why I'm forced to use param_cast 'integer' for that purpose.
Mensajes Tue 14 Jan 25 @ 10:34 pm
Works! Thank you LOCODOG so much!
I can't believe it was all about brackets. I tried to used them in the middle of my code and they didn't work, but once I used the code that you shared above it works perfectly, so maybe I need to play a bit with that!
Btw. thank you both for "down" function, I just started learning VDJ scripting and wasn't aware of that - it will be much easier to use it.
Thank you once again!
I can't believe it was all about brackets. I tried to used them in the middle of my code and they didn't work, but once I used the code that you shared above it works perfectly, so maybe I need to play a bit with that!
Btw. thank you both for "down" function, I just started learning VDJ scripting and wasn't aware of that - it will be much easier to use it.
Thank you once again!
Mensajes Tue 14 Jan 25 @ 10:45 pm