denemo-devel
[Top][All Lists]
Advanced

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

Re: [Denemo-devel] Linking your Denemo score to the original source


From: Dominic Sacré
Subject: Re: [Denemo-devel] Linking your Denemo score to the original source
Date: Fri, 17 Feb 2012 02:13:35 +0100
User-agent: KMail/1.13.5 (Linux/2.6.32-38-generic; KDE/4.4.5; i686; ; )

On Monday 06 February 2012 18:46:48 Richard Shann wrote:
> I can see one error in the code (which may well be harmless)
>     if (event_time == 0.0)  at jackbackend.c:146
> does not have the meaning intended. I think the meaning intended
> would be expressed in C as
> 
> if(!((event_time>0.0)||(event_time<0.0))) 
> 
> the original code only checks for equality with one possible
> representation of a double precision floating point zero value, there
> will be more than one usually. Perhaps what the code is really
> intending to do is check for some initial condition though, which
> would be better done explicitly...

Actually, the check for event_time == 0.0 is correct, but it should be 
better documented.
It's true that a value of 0.0 has a bit of a special meaning. Basically 
there are two kinds of events that are output by denemo: Those that are 
part of the score being played back, and those that result from 
immediate user input.

For events from the score we know their exact time, and we can use that 
to ensure sample-accurate playback. That is, if it's supported by the 
backend and the underlying audio/MIDI API, and so far that's only the 
case with JACK MIDI. (It would be nice if we could do the same for JACK 
audio and portaudio, but I think I hit a limitation of the fluidsynth 
API there...)

Events from user interaction (like note input) don't have any time stamp 
attached to them, so an event_time value of 0.0 is essentially a flag 
meaning "just play this as soon as you can".


Dominic



reply via email to

[Prev in Thread] Current Thread [Next in Thread]