|
From: Edwin V. <re...@uw...> - 2005-06-27 13:01:17
|
On Mon, Jun 27, 2005 at 09:48:16AM +0200, St?phane Letz wrote: > > >I was hoping somebody close to midishare internals could quickly > >answer > >this question for me instead of me searching through the code. What is > >used as the software synth in Mac OS X in MidiShare? Is it the > >QuickTime > >synth or CoreMidi? > > The MidiShare driver msQTDriver still uses the QTMA architecture, but > we did not see hight latencies as you seems to have. > How do you measure this 100ms latency value? Through some simple user trials. I had a small animation of a bouncing ball and used QTMA to play some percussive sound at the exact millesecond the ball hit the plane (using the SMPTE midi time codes). I made a series of trials with the 'music' track offset from the video from about 300ms too early through 300ms too late. I just asked if the percussive sounds came before or after the ball bounce. Some statistics centered the latency around 100ms. Unless I was doing something wrong (although I did try very hard to make it work), the latency is pretty obvious when you play a quicktime movie that has a QTMA soundtrack alongside a video track. > >Via my experiments with QTMA in QuickTime (before I > >discovered QTMA was deprecatd), I discovered that QTMA in QuickTime is > >quite laggy (about 100ms in experiments). I ended up writing a new > >media > >handler that uses CoreMidi instead. However, when trying to play > >QuickTime movies with my new handler, playback can sound ever so > >slightly 'uneven' since movie players usually tell media players to > >play > >every 20 ms or so. > > Do you mean you're playing a MIDIFile with your new handler? Sort of. I came up with a new format for internal storage. QuickTime plays midi files by first converting them into QTMA info which is stored in tracks. My version of 'QTMA' is much more like midi (and pretty simple) since all I care about is passing events eventually to CoreMidi to play. So in theory, it's possible for my media handler to play standard midi files, I would just need to write a converter (like an Import Component). My problem is that my media handler is pretty simple and just plays all events that have occurred since the last time events were played up until the current point in time. Since the polling interval from your typical movie player is about 20ms, sometimes you get some detectable unevenness in the music (seeing as though our aural acuity is only a couple of milliseconds and I'm dealing with repetitive music). I was hoping for a simple solution to do basic scheduling to eliminate the unevenness. Edwin V |