I have some comments on pieces of code. I think this is at least close
to correct, but see if my comments match your assumptions. If I had more
time I'd try to construct equations for the output time of audio and
output time of midi and show they are (or are not) equal.
> PmTimestamp timeProc(void *timeData) {
> PaStream *pas = (PaStream *) timeData ;
> PaTime t = Pa_GetStreamTime( pas );
> return (PmTimestamp) (int64_t) ( t * 1000 + .5 ) ;
// so PortAudio timestamps correspond to Pa_GetStreamTime
// (whatever that means)
> data->start = (PmTimestamp) ( timeInfo->outputBufferDacTime *
> 1000 + .5 );
// midi is output with timestamps of data->start + N, where timestamps
// correspond to Pa_GetStreamTime. How does this relate to
// outputBufferDacTime?
> Pm_WriteShort( data->midiStream,
> data->start + (data->iterations)*1000,
> Pm_Message( 0x90, 0x3C, 0x60 ) );
// Midi output time will be data->start + N * 1000 + latency
// It looks to me like you should subtract the midi latency parameter
// from the timestamp here
>
_______________________________________________
media_api mailing list
[email protected]
http://lists.create.ucsb.edu/mailman/listinfo/media_api