Cabbage Logo
Back to Cabbage Site

DAW Clock Sync?

Is there a way to trigger something to be in sync with the host? Possible with TIME_IN_SECONDS ? For instance - I have a rhythmic sequence that automatically triggers at the HOST_BPM tempo. But how can I get it to start on a downbeat w/o user intervention?

OK, maybe i answered my own question… I guess this has to be triggered at k rate by listing to “IS_PLAYING”?

Yes, IS_PLAYING will let you know when the session has started playback, after that you should query HOST_PPQ_POS. That should get you sorted.

So you can just get a trigger from HOST_PPQ_POS but there’s no actual time value like with metro so you cannot operate on it - like change it to 8th notes.

Basically I need metro to trigger on the quarter note. Or maybe there’s a different opcode?

Right - I think I got this sorted simply by triggering the instrument with metro in it with another instrument that listens for IS_PLAYING. Seems to stay in sync like that :upside_down_face:

So as soon as IS_PLAYING is triggers, you simple sequence notes using a metro, according to the current BPM? Just keep in mind there might be some timing issues. If your kr is set to 16, it gives you have an max error margin of 16/SR. So it could take 16/SR seconds for your plugin to react. In reality it will rarely ever be this much. It is pretty small, but enough to annoy the sample-accurate timing mob :rofl:

Exactly. Sample accuracy - ha… this is a plugin for making ambient music :laughing:

:rofl: