Re: [Audacity-devel] [Audacity-nyquist] Patch improving Nyquist input behavior
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: Gale A. <ga...@au...> - 2009-10-23 21:33:25
|
| From Al Dimond <bus...@gm...> | Fri, 23 Oct 2009 13:33:38 -0600 | Subject: [Audacity-devel] [Audacity-nyquist] Patch improving Nyquist input behavior > On Friday 23 October 2009 12:57:24 Vaughan Johnson wrote: > > Al Dimond wrote: > > > On Friday 23 October 2009 02:27:50 Gale Andrews wrote: > > >> Hi Al > > >> > > >> On VisualStudio, I got the following compile error after running > > >> this patch: > > >> > > >> Nyquist.cpp > > >> ..\..\..\src\effects\nyquist\Nyquist.cpp(1070) : error C2668: > > >> 'pow' > > >> > > >> : ambiguous call to overloaded function C:\Program > > >> : Files\Microsoft > > >> > > >> Visual Studio 9.0\VC\include\math.h(575): could be 'long double > > >> pow(long double,int)' C:\Program Files\Microsoft Visual Studio > > >> 9.0\VC\include\math.h(527): or 'float pow(float,int)' > > >> C:\Program Files\Microsoft Visual Studio > > >> 9.0\VC\include\math.h(489): or 'double pow(double,int)' > > >> while trying to match the argument list '(int, int)' > > >> ..\..\..\src\effects\nyquist\Nyquist.cpp(1072) : error C2668: > > >> 'pow' : ambiguous call to overloaded function C:\Program > > >> Files\Microsoft Visual Studio 9.0\VC\include\math.h(575): could > > >> be 'long double pow(long double,int)' C:\Program Files\Microsoft > > >> Visual Studio 9.0\VC\include\math.h(527): or 'float > > >> pow(float,int)' C:\Program Files\Microsoft Visual Studio > > >> 9.0\VC\include\math.h(489): or 'double pow(double,int)' > > >> while trying to match the argument list '(int, int)' > > > > > > Really!?!?! OK. On each of those lines the first argument to > > > pow() is the literal 10. Does it build if you cast each of them > > > to a double? Or change them to 10.0... although that's probably > > > just as ambiguous. > > > > You just need to change them to 10.0 (e.g.) or 10.0f or whatever > > you're actually intending. This happens pretty often due to > > compile differences. > > > > Ah, that must be why I see so much code (in Audacity and elsewhere) > using forms like 10.0 all over the place when 10 usually suffices for > me. For anyone looking to build with VC, a new patch that hopefully > builds there straightaway is attached (I don't have an installation to > test on ATM). Thanks, Al. I'd already modified: newVal *= pow(10, precision); newVal /= pow(10, precision); in the old patch to read "10.0" in both cases and that did the trick for me. I tested the patch cursorily on Windows XP in High Pass and Low Pass to make sure that typing values in the boxes is now respected when you reopen the effect. I also changed the default value in Low Pass to verify that changed default was used when launching Audacity afresh. I tried Pluck, though I don't think it was affected by this bug. > makes it easier for users to enter values into the text boxes at > higher precision than what's usually displayed (it used to be > that they could not touch other sliders without having their > custom values rounded to the nearest slider "tick"). That works for me in High Pass and Low Pass. Gale |