Cabbage Logo
Back to Cabbage Site

Syncing Csound's clock to the VST host

Hey everyone,

Can you think of a way to sync Csound’s internal clock to the VST host transport? I know we have the Reserved Channels to get time and frames information. But I can’t think of a way to use that to drive Csound’s clock.

I’ve already tried the setscorepos opcode and also a-statements. But of course those weren’t designed to be used as a tick driver. The other thing I tried was to use the -+rtaudio=jack option and the Jacko opcodes, but those would cause the host to hang.

Any ideas would be very welcome! Cheers.

By Csound’s internal clock I assume you mean the time passed since Csound was started? This should match what you have in the host already as the plugin will only start once you it play? Or?

Also, have you seen this:

Hi Rory,

Sorry about the category type. Cabbage Stew didn’t seem to fit the question when I was choosing from the category combobox. Anyway. I remember reading the post you linked when you posted it the first time, but unfortunately it isn’t the tempo what I’m trying to set, but the internal clock.

Having opcodes like setscorepos means Csound has something like a rewindable clock. It would be nice to be able to link that to the host transport. The only thing we would need to take care of would be that multiple instances of the same instrument could be fired up by rewinding to a certain time.

Otherwise, how can you create an audio file player that is synced to the transport? I’ve tried with some of the looper opcodes and TIME_IN_SECONDS as the loop start time, but it isn’t very accurate. Maybe it would be easier and more sample-accurate to just modify the audio file player plugin you created for the host of Cabbage 1 with Juce.

EDIT: Because of how the score events are scheduled I think even if it’s possible to achieve what I propose here, it’s a poor decision regarding the overall design strategy. I’ll just stick to flooper2, deferred gen01 tables and simple arithmetic for playing audio files in sync with the transport host.

I’ve been there before!! :joy: