Re: [LAU] Clipping as a 64-bit issue?

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

 



On Sat, 2007-05-26 at 21:12 -0700, Ken Restivo wrote:
> On Sat, May 26, 2007 at 05:14:21PM -0400, Dave Robillard wrote:
> > On Sat, 2007-05-26 at 12:25 -0700, Ken Restivo wrote:
> > > -----BEGIN PGP SIGNED MESSAGE-----
> > > Hash: SHA1
> > > 
> > > I've noticed the same strange behaviour in two completely different peices of software/hardware, and have to wonder if it's a integer-size issue.
> > > 
> > > First of all, the AZR3 LV2 softsynth clips on my 64-bit machine. Really bad. Lars looked at it, and gave me the action item to go digging through the source and test the sound at various points in the processing chain, to try to isolate it further. Which I am still going to do.
> > 
> > The horrible noise on 64-bit from AZR3 (for me) comes from the key
> > click.  Turn the click control all the way down and it works fine.
> > 
> 
> I just discovered this a few hours ago. And came up with a hack to fix it... AZR3 now works on my 64-bit machine, including the click!
> 
> I sent the patch below to larsl but he appears to be AFK right now.
> 
> Still not sure what's up with the Audiophile.
> 
> - -ken
> - -------------
> 
> Index: plugins/azr3/voice_classes.cpp
> ===================================================================
> RCS file: /sources/ll-plugins/ll-plugins/plugins/azr3/voice_classes.cpp,v
> retrieving revision 1.7
> diff -u -b -B -w -p -u -b -B -w -p -r1.7 voice_classes.cpp
> - --- plugins/azr3/voice_classes.cpp	16 May 2007 10:10:05 -0000	1.7
> +++ plugins/azr3/voice_classes.cpp	27 May 2007 00:50:23 -0000
> @@ -229,7 +229,7 @@ float voice::clock()
>  				static unsigned long randSeed = 22222;
>  				float rand=0;
>  				randSeed = (randSeed * 196314165) + 907633515;
> - -				rand=(float)randSeed/0xffffffff;
> +				rand=(float)randSeed/0xfffffffffffffff;
>  				clicklp.clock(click*rand*.3f);
>  				noise=clicklp.bp()*clickvol*.7f;
>  				output+=noise;
> @@ -286,7 +286,7 @@ float voice::clock()
>  		if(mattack>1)
>  			mattack=1;
>  		randSeed = (randSeed * 196314165) + 907633515;
> - -		rand=(float)randSeed/0xffffffff;
> +		rand=(float)randSeed/0xfffffffffffffff;
>  		clicklp.clock(click*rand*.3f);
>  		noise=clicklp.bp();
>  		noise*=clickvol;

This patch has been applied to CVS now (with the large hex numbers
replaced by std::numeric_limits<unsigned long>::max()). I think it
should work on all platforms but I still have no 64-bit machine to test
it with.


--ll

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@xxxxxxxxxxxxxxxxxxxx
http://lists.linuxaudio.org/mailman/listinfo.cgi/linux-audio-user

[Index of Archives]     [Linux Sound]     [ALSA Users]     [Pulse Audio]     [ALSA Devel]     [Sox Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux