Cabbage Logo
Back to Cabbage Site

Inquiry on syncing Csound instances

hey folks, back again with another issue on my Constellation project. i have discovered that the sync between my various Csound sequencer instances is slightly off. i recall that Rory cautioned me about this issue, so it’s not surprising to encounter it.

while i know that the ultimate solution will be to make all 16 layers in one script i’m curious if there might be a way to utilize audioSettings.dspTime in Unity to schedule the enabling of Csound. right now in my testing i’m using Update or FixedUpdate and the results aren’t too good. i’m looping through each Layer and enabling the sequencer but it results in the odd and even numbered channels being about 100 msec apart in timing. this is at 60 bpm at the moment.

i have the flexibility to delay compensate since there currently is no live triggering needed, so i could hold playback for the less latent tracks until they catch up to the even numbered ones. right now i’m utilizing Echo plugins on the Unity Mixer but and it actually seems to work pretty well, but would be interesting to explore other methods to schedule playback.

anyway just curious what’s possible!

I never tried syncing separate Csound instances using the OnAudioFilterRead callback. It should be possible setting a Csound channel that enables a track to play. You could need to tweak the control rate to achieve a better sync.

1 Like

Hi. Maybe you can use rtclock to let all instances sync to the OS clock? In each instance, check where you are in relation to the system clock and then communicate the required latency via osc (?)

1 Like

thanks you two! as far as the Layers they are currently at ksamps = 100 so control rate at 480. i’ve messed with smaller ksamps values but it doesn’t get better latency at least to me. not sure of the sync though.

i guess the first hurdle is figuring out which layer has the largest latency and then adjusting delay based on that but i don’t know how to make that happen. everything should be happening in the same frame under Update but with half of the layers being delayed by that much it makes me suspicious that not all the tracks are being processed in the same frame.