Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 41707 Details for
Bug 65752
GCC 3.4.2 alignment bug possibly, media-sound/zynaddsubfx-2.0.0 crashes
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
src/Synth/OscilGen.C: OscilGen::prepare()
OscilGen-prepare.C (text/plain), 2.87 KB, created by
Eric Shattow
on 2004-10-13 04:29:12 UTC
(
hide
)
Description:
src/Synth/OscilGen.C: OscilGen::prepare()
Filename:
MIME Type:
Creator:
Eric Shattow
Created:
2004-10-13 04:29:12 UTC
Size:
2.87 KB
patch
obsolete
>void OscilGen::prepare(){ > int i,j,k; > REALTYPE a,b,c,d,hmagnew; > > if ((oldbasepar!=Pbasefuncpar)||(oldbasefunc!=Pcurrentbasefunc)|| > (oldbasefuncmodulation!=Pbasefuncmodulation)|| > (oldbasefuncmodulationpar1!=Pbasefuncmodulationpar1)|| > (oldbasefuncmodulationpar2!=Pbasefuncmodulationpar2)|| > (oldbasefuncmodulationpar3!=Pbasefuncmodulationpar3)) > changebasefunction(); > > for (i=0;i<MAX_AD_HARMONICS;i++) hphase[i]=(Phphase[i]-64.0)/64.0*PI/(i+1); > > for (i=0;i<MAX_AD_HARMONICS;i++){ > hmagnew=1.0-fabs(Phmag[i]/64.0-1.0); > switch(Phmagtype){ > case 1:hmag[i]=exp(hmagnew*log(0.01)); break; > case 2:hmag[i]=exp(hmagnew*log(0.001));break; > case 3:hmag[i]=exp(hmagnew*log(0.0001));break; > case 4:hmag[i]=exp(hmagnew*log(0.00001));break; > default:hmag[i]=1.0-hmagnew; > break; > }; > > if (Phmag[i]<64) hmag[i]=-hmag[i]; > }; > > //remove the harmonics where Phmag[i]==64 > for (i=0;i<MAX_AD_HARMONICS;i++) if (Phmag[i]==64) hmag[i]=0.0; > > > for (i=0;i<OSCIL_SIZE;i++) oscilFFTfreqs[i]=0.0; > if (Pcurrentbasefunc==0) {//the sine case > for (i=0;i<MAX_AD_HARMONICS;i++){ > oscilFFTfreqs[i+1]=-hmag[i]*sin(hphase[i]*(i+1))/2.0; > oscilFFTfreqs[OSCIL_SIZE-i-1]=hmag[i]*cos(hphase[i]*(i+1))/2.0; > }; > } else { > for (j=0;j<MAX_AD_HARMONICS;j++){ > if (Phmag[j]==64) continue; > for (i=1;i<OSCIL_SIZE/2;i++){ > k=i*(j+1);if (k>OSCIL_SIZE/2) break; > a=basefuncFFTfreqs[i]; > b=basefuncFFTfreqs[OSCIL_SIZE-i]; > c=hmag[j]*cos(hphase[j]*k); > d=hmag[j]*sin(hphase[j]*k); > oscilFFTfreqs[k]+=a*c-b*d; > oscilFFTfreqs[OSCIL_SIZE-k]+=a*d+b*c; > }; > }; > > }; > > if (Pharmonicshiftfirst!=0) shiftharmonics(); > > > > if (Pfilterbeforews==0){ > waveshape(); > oscilfilter(); > } else { > oscilfilter(); > waveshape(); > }; > > modulation(); > spectrumadjust(); > if (Pharmonicshiftfirst==0) shiftharmonics(); > >/* //normalize (sum or RMS) - the "Full RMS" normalisation is located in the "::get()" function > if ((Pnormalizemethod==0)||(Pnormalizemethod==1)){ > REALTYPE sum=0; > for (j=1;j<OSCIL_SIZE/2;j++) { > REALTYPE term=oscilFFTfreqs[j]*oscilFFTfreqs[j]+oscilFFTfreqs[OSCIL_SIZE-j]*oscilFFTfreqs[OSCIL_SIZE-j]; > if (Pnormalizemethod==0) sum+=sqrt(term); > else sum+=term; > }; > if (sum<0.00000001) sum=1.0; > if (Pnormalizemethod==1) sum=sqrt(sum)*2.0; > sum*=0.5; > for (j=1;j<OSCIL_SIZE;j++) oscilFFTfreqs[j]/=sum; > }; >*/ > oscilFFTfreqs[0]=0.0;//remove the DC > > if (ANTI_ALIAS==0) { > //Perform the IFFT in case of Antialiasing is disabled > REALTYPE *tmp=new REALTYPE[OSCIL_SIZE]; > for (i=0;i<OSCIL_SIZE;i++) tmp[i]=oscilFFTfreqs[i]; > fft->freqs2smps(tmp,oscilFFTfreqs); > //now the oscilFFTfreqs contains samples data in TIME-DOMAIN (despite it's name) > delete(tmp); > }; > oldhmagtype=Phmagtype; >// oldnormalizemethod=Pnormalizemethod; > oldharmonicshift=Pharmonicshift+Pharmonicshiftfirst*256; > > oscilprepared=1; >}; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 65752
:
40681
|
41704
|
41705
|
41707
|
41757
|
41759
|
41763
|
41764
|
41766
|
41778