QWAIT

Description:

qwait will calculate the ms to the next bar and trigger your given action list after that. You can specify how many bars you want to wait, if you don’t specify any length, it will happen on the next bar.

[] qwait 1 "METRO"

for example will trigger METRO AFTER the beginning of the next bar.

Usage

Important: The action list has to go into double quotes " if you want to use names, just use single quotes: '

Examples: [] qwait 2 "1 / CLIP(SEL) QNTZ 1/8

these three do all the same, if the second track is name “BASS”:

  • [] qwait 1 "2 / ARM OFF"
  • [] qwait 1 "'BASS' / ARM OFF"
  • [] qwait "2 / ARM OFF"

This is a very useful UA for actions that need to happen shortly after a bar starts. e.g. quantising audio or applying a groove to a clip or disarming a track.

Safety buffer

To make sure the action list is triggered AFTER the first beat of the next bar, I added a “safety” value of ms automatically added. If you have any issues or want to play around with that, you can set the delay like this:

[] qwait safety 3 will always add the value of 3 to the wait value.

Default value is 1, which turned out to be just enough to get it over the finish line every time. We are talking about tenths of a second. the WAIT action takes the value for hundereds of milliseconds, [] wait 10 is waiting for 1 second. This change will persist for any qwait action in that session, but reset to 1 if a new set is loaded. So you might want to put into you Preferences.txt under STARTUP_ACTIONS like so: STARTUP_ACTIONS = SOMEACTION; QWAIT SAFETY 3 ; DIFFERENT_ACTION ;

OFFSET

I also built in the possibilty to apply an offset, which can be negative, e.g. if you want to happen something close, but BEFORE the beginning of a next bar. this option is not permanent, so you have to add it to each trigger of the action:

[] qwait 1 offset=-2 "2 / ARM OFF"

Because an = is not accepted in Macros you can simply omit it and trigger like this: [] qwait 1 offset-2 "2 / ARM OFF" [] qwait 1 offset -2 "2 / ARM OFF" or even without a whitespace:

It should catch what ever number is after offset and before the action in quotes. The 1 (or any other length to wait) after QWAIT and before OFFSET is mandatory though to make it work.

This will NOT work: [] qwait offset-2 "2 / ARM OFF"

It will add the safety value and calculate the remaining ms to the next bar accordingly. In this case, with the safety by default set to 1, minus 2 for offset, it will trigger the action 100ms BEFORE the start of the next bar. That being said, if safety value is 1 and you use offset=-1 it is theoretically exactly on the start, but in experiments it turned out it can be JUST SLIGHTLY before the downbeat which is not good for time critical actions.