[LAU] Need some programming help.

Tito Latini tito.01beta at gmail.com
Fri Nov 22 00:33:08 UTC 2013


On Thu, Nov 21, 2013 at 07:22:31PM +0000, Will Godfrey wrote:
> Thank you both for your suggestions. I tried that bit of code, but as I rather
> expected it behaved perfectly.
> 
> The problem seems to be that, for some reason FLTKs 'step' command is being
> ignored. Not only is it failing to round the values but it is also failing to
> truncate them. I even tried replacing the calculated value with a simple
> integer - loads of trailing zeros after the decimal point.
> 
> Yoshi is derived from Zyn, and the section of code that sends values to FLTK
> for display is identical, yet Zyn doesn't show this problem. I can only guess
> there is some difference in the way yoshi links to FLTK but can't imagine what
> it is! 

I'm noticing a possible bug generator in a diff between
`ZynAddSubFX-2.4.3' and `yoshimi-1.1.0':

diff -u ZynAddSubFX-2.4.3/src/UI/ADnoteUI.fl \
     yoshimi-1.1.0/src/UI/ADnoteUI.fl | grep lrintf
+          callback {pars->VoicePar[nvoice].PVolume = lrintf(o->value());}
+          callback {pars->VoicePar[nvoice].Presonance = lrintf(o->value());}
[...]

!! | wc -l
72

The method `value' of Fl_Valuator returns a "double" and `lrintf'
requires "float".

The implementation of `lrintf' depends on the machine (for example, in
glibc-2.15, it uses the instruction CVTSD2SI for x86_64).

You could try `lrint' or the follow trick:

  http://music.columbia.edu/pipermail/music-dsp/2013-September/071566.html


More information about the Linux-audio-user mailing list