[linux-audio-user] Developers: how to sync PCM to Midi?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello folks,

I'm writing a realtime audio tool and I'd like to pick your brains on the 
following: say my app is rendering some sound and a midi event comes in, at 
what point in time should the resulting effect occur in the rendered audio 
stream?

The obvious solution would be to measure world/system time at the moment 
playback is started in my application. If a midi event then comes in, I can 
subtract this start time from the midi event time. I am however afraid that 
my timing will then drift each time an underrun occurs. I'm pretty sure 
applications like terminatorx, sweep and a host of others solved this 
problem before me so if anybody knows the answer to this, please let me 
know!

Regards,

Denis

p.s. I use JACK for audio output but the solution really should be 
independent of this.

---------------
www.cyozlab.com

_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
http://join.msn.com/?page=features/virus



[Index of Archives]     [Linux Sound]     [ALSA Users]     [Pulse Audio]     [ALSA Devel]     [Sox Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux