Re: [LAU] Need some programming help.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Will Godfrey <willgodfrey@...>
Cc: <linux-audio-user@...>
Date: Monday, March 3, 2014 - 5:59 pm

On Sun, Mar 02, 2014 at 11:18:30PM +0000, Will Godfrey wrote:

Now I'm using gcc-4.8.2 and I can reproduce the problem.

Only a rapid glance: with

/* From Fl_Valuator.cxx */
void Fl_Valuator::step(double s) {
if (s < 0) s = -s;
A = rint(s);
B = 1;
while (fabs(s-A/B) > epsilon && B<=(0x7fffffff/10)) {B *= 10; A = rint(s*B);}
}

there is a roundoff error but if we use the simplest

/* From Fl_Valuator.H */
void step(double a, int b) {A = a; B = b;}

the problem disappears

--- yoshimi-1.1.0~/src/UI/ADnoteUI.fl 2013-05-08 09:47:45.000000000 +0200
+++ yoshimi-1.1.0/src/UI/ADnoteUI.fl 2014-03-03 14:41:58.054425629 +0100
@@ -89,8 +89,9 @@
} {}
Fl_Value_Output detunevalueoutput {
callback {o->value(getDetune((pars->VoicePar[nvoice].PDetuneType == 0) ? (pars->GlobalPar.PDetuneType) : (pars->VoicePar[nvoice].PDetuneType), 0, pars->VoicePar[nvoice].PDetune) * pars->getBandwidthDetuneMultiplier());}
- xywh {265 5 45 20} labelsize 10 align 5 minimum -5000 maximum 5000 step 0.01 textfont 1 textsize 10
- code0 {o->value(getDetune(pars->VoicePar[nvoice].PDetuneType, 0, pars->VoicePar[nvoice].PDetune) * pars->getBandwidthDetuneMultiplier());}
+ xywh {265 5 45 20} labelsize 10 align 5 minimum -5000 maximum 5000 textfont 1 textsize 10
+ code0 {o->step(0.01, 1);}
+ code1 {o->value(getDetune(pars->VoicePar[nvoice].PDetuneType, 0, pars->VoicePar[nvoice].PDetune) * pars->getBandwidthDetuneMultiplier());}
}

[ ... censored for avoiding noise in LAU; the complete patch is in a private msg ]

Tito Latini
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-user

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[LAU] Need some programming help., Will Godfrey, (Mon Nov 18, 9:14 pm)
Re: [LAU] Need some programming help., Tito Latini, (Tue Nov 19, 12:01 pm)
Re: [LAU] Need some programming help., Will Godfrey, (Thu Nov 21, 7:22 pm)
Re: [LAU] Need some programming help., Tito Latini, (Fri Nov 22, 12:36 am)
Re: [LAU] Need some programming help., Will Godfrey, (Sun Mar 2, 11:19 pm)
Re: [LAU] Need some programming help., Tito Latini, (Mon Mar 3, 5:59 pm)
Re: [LAU] Need some programming help., Will J Godfrey, (Mon Mar 3, 6:50 pm)
Re: [LAU] Need some programming help., James Morris, (Tue Nov 19, 12:53 am)