Can I sync slots with the SunVox DLL?

Multi-platform modular music creation studio
Post Reply
grig
Posts: 14
Joined: Tue Nov 12, 2019 12:31 am

Can I sync slots with the SunVox DLL?

Post by grig »

Hi again! :)

How would I do the following using the SunVox DLL?

1. Load song 1 into slot 1
2. Play slot 1 in a loop
... time passes ...
3. Load song 2 into slot 2
4. Stop slot 1 and Play slot 2 at the beginning of the next 4 bar interval

I can't figure out the last step (#4). How can I have the timing be perfect when I switch slots?

Thank you so much for all your help!

Peace.
Grig
User avatar
NightRadio
Site Admin
Posts: 3944
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: Can I sync slots with the SunVox DLL?

Post by NightRadio »

Stop slot 1 and Play slot 2 at the beginning of the next 4 bar interval
How can I have the timing be perfect when I switch slots?
There is no perfect way to sync it at the sample level.
You can try to use sv_get_current_line2() to periodically get the current position - this value can be used for synchronization
grig
Posts: 14
Joined: Tue Nov 12, 2019 12:31 am

Re: Can I sync slots with the SunVox DLL?

Post by grig »

Is there some way to use sv_send_event() and sv_send_event_t() to schedule stop and play events?
User avatar
NightRadio
Site Admin
Posts: 3944
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: Can I sync slots with the SunVox DLL?

Post by NightRadio »

You can send NOTECMD_PLAY and NOTECMD_STOP, but I'm not sure if this will somehow help you in this task.
With sv_send_event_t() you can schedule the events in system time space, but not in the local SunVox ticks.

You can synchronize the slots with sample precision, but for this you have to use sv_audio_callback() and your own audio playback code.
grig
Posts: 14
Joined: Tue Nov 12, 2019 12:31 am

Re: Can I sync slots with the SunVox DLL?

Post by grig »

Cool - that's what I had concluded, but it's great to hear it from you. Thanks again! :)
Post Reply