Re: Reflections on writing a sequencer

I think you would do node.noteOn(e.playbackTime +
(samplesWrittenThisCallback / sampleRate)).


On Thu, Jul 26, 2012 at 10:56 AM, Peter van der Noord <peterdunord@gmail.com
> wrote:

> can you give an example?
>
> Let's say i am in my buffer-write loop (in response to an
> AudioProcessingEvent), and at a certain point in that loop (i may or may
> not have written a number of values already) i want to call note-on on
> another node to be fired exactly at the same time that the buffervalue i'm
> writing (or about to write) would reach the soundcard. how would that work?
>
> at least, that's what i understand i can do then...?
>
>
>> An AudioProcessingEvent exposes the exact time of the audio to be generated in the sample stream as the "playbackTime" attribute.  Not that this makes callbacks any more useful as a source of exact timing, but it does mean that there is no need to keep track of time in separate variables.
>>
>>

Received on Thursday, 26 July 2012 15:03:03 UTC