zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

commit 5bbb07a8fadc6808353927a19dd6965f437c33de
parent 1d5a39ff8e877c8c33be86f1034b5e2e5b4f9d5f
Author: paulnasca <paulnasca>
Date:   Sat, 14 Aug 2004 18:25:23 +0000

*** empty log message ***

Diffstat:
MChangeLog | 3++-
Msrc/Params/Makefile | 2+-
Msrc/Params/PADnoteParameters.C | 1+
Asrc/Params/Presets.C | 21+++++++++++++++++++++
Asrc/Params/Presets.h | 21+++++++++++++++++++++
Msrc/Synth/OscilGen.C | 35+++++++++++++++++++----------------
Asrc/UI/PresetsUI.fl | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
7 files changed, 129 insertions(+), 18 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -682,5 +682,6 @@ -------------------------------------------------------------------------------------------------- 13 Aug 2004 - Inceput sa scriu modurile continous si discrete la PADnote 14 Aug 2004 - Terminat modul continous la PADnote - + - Corectata o mica eroare la OscilGen care facea daca adaptive harmonics e activ si phase randomness>0 sa rezulte si aleatorism in amplitudinile armonicelor + - Inceput sa scriu Presets/Clipboard diff --git a/src/Params/Makefile b/src/Params/Makefile @@ -1,7 +1,7 @@ include ../Makefile.inc objects=ADnoteParameters.o EnvelopeParams.o FilterParams.o \ - LFOParams.o SUBnoteParameters.o PADnoteParameters.o Controller.o + LFOParams.o SUBnoteParameters.o PADnoteParameters.o Controller.o Presets.o all: $(objects) diff --git a/src/Params/PADnoteParameters.C b/src/Params/PADnoteParameters.C @@ -66,6 +66,7 @@ PADnoteParameters::~PADnoteParameters(){ }; void PADnoteParameters::defaults(){ + Pmode=0; Php.base.type=0; Php.base.par1=80; Php.freqmult=0; diff --git a/src/Params/Presets.C b/src/Params/Presets.C @@ -0,0 +1,21 @@ +/* + ZynAddSubFX - a software synthesizer + + Presets.C - Presets and Clipboard management + Copyright (C) 2002-2004 Nasca Octavian Paul + Author: Nasca Octavian Paul + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License + as published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License (version 2) for more details. + + You should have received a copy of the GNU General Public License (version 2) + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ diff --git a/src/Params/Presets.h b/src/Params/Presets.h @@ -0,0 +1,21 @@ +/* + ZynAddSubFX - a software synthesizer + + Presets.h - Presets and Clipboard management + Copyright (C) 2002-2004 Nasca Octavian Paul + Author: Nasca Octavian Paul + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License + as published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License (version 2) for more details. + + You should have received a copy of the GNU General Public License (version 2) + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ diff --git a/src/Synth/OscilGen.C b/src/Synth/OscilGen.C @@ -864,6 +864,21 @@ short int OscilGen::get(REALTYPE *smps,REALTYPE freqHz,int resonance){ int realnyquist=nyquist; if (Padaptiveharmonics!=0) nyquist=OSCIL_SIZE/2; + for (i=1;i<nyquist-1;i++) { + outoscilFFTfreqs[i]=oscilFFTfreqs[i]; + outoscilFFTfreqs[OSCIL_SIZE-i]=oscilFFTfreqs[OSCIL_SIZE-i]; + }; + + adaptiveharmonic(outoscilFFTfreqs,freqHz); + + nyquist=realnyquist; + if (Padaptiveharmonics){//do the antialiasing in the case of adaptive harmonics + for (i=nyquist;i<OSCIL_SIZE/2;i++) { + outoscilFFTfreqs[i]=0; + outoscilFFTfreqs[OSCIL_SIZE-i]=0; + }; + }; + // Randomness (each harmonic), the block type is computed // in ADnote by setting start position according to this setting @@ -872,28 +887,16 @@ short int OscilGen::get(REALTYPE *smps,REALTYPE freqHz,int resonance){ rnd=PI*pow((Prand-64.0)/64.0,2.0); for (i=1;i<nyquist-1;i++){//to Nyquist only for AntiAliasing angle=rnd*i*RND; - a=oscilFFTfreqs[i]; - b=oscilFFTfreqs[OSCIL_SIZE-i]; + a=outoscilFFTfreqs[i]; + b=outoscilFFTfreqs[OSCIL_SIZE-i]; c=cos(angle); d=sin(angle); outoscilFFTfreqs[i]=a*c-b*d; outoscilFFTfreqs[OSCIL_SIZE-i]=a*d+b*c; }; - } else { - for (i=1;i<nyquist-1;i++) { - outoscilFFTfreqs[i]=oscilFFTfreqs[i]; - outoscilFFTfreqs[OSCIL_SIZE-i]=oscilFFTfreqs[OSCIL_SIZE-i]; - }; }; - adaptiveharmonic(outoscilFFTfreqs,freqHz); - nyquist=realnyquist; - if (Padaptiveharmonics){//do the antialiasing in the case of adaptive harmonics - for (i=nyquist;i<OSCIL_SIZE/2;i++) { - outoscilFFTfreqs[i]=0; - outoscilFFTfreqs[OSCIL_SIZE-i]=0; - }; - }; + //Harmonic Amplitude Randomness @@ -941,7 +944,7 @@ short int OscilGen::get(REALTYPE *smps,REALTYPE freqHz,int resonance){ // for (i=0;i<OSCIL_SIZE/2;i++) outoscilFFTfreqs[i+OSCIL_SIZE/2]*=-1.0;//correct the amplitude - if ((ADvsPAD)&&(freqHz>0.1)){ + if ((ADvsPAD)&&(freqHz>0.1)){//in this case the smps will contain the freqs for (i=1;i<OSCIL_SIZE/2;i++) smps[i-1]=sqrt(outoscilFFTfreqs[i]*outoscilFFTfreqs[i]+outoscilFFTfreqs[OSCIL_SIZE-i]*outoscilFFTfreqs[OSCIL_SIZE-i]); } else { fft->freqs2smps(outoscilFFTfreqs,smps); diff --git a/src/UI/PresetsUI.fl b/src/UI/PresetsUI.fl @@ -0,0 +1,64 @@ +# data file for the Fltk User Interface Designer (fluid) +version 1.0105 +header_name {.h} +code_name {.cxx} +class PresetsUI {open +} { + Function {make_window()} {open + } { + Fl_Window {} { + label {Copy to Clipboard/Preset} open + xywh {511 241 265 315} type Double hide modal + } { + Fl_Browser {} { + xywh {10 30 245 200} + } + Fl_Button {} { + label {Copy to Preset} + xywh {75 240 120 20} box THIN_UP_BOX + } + Fl_Button {} { + label {Copy to Clipboard} + xywh {25 270 90 40} box THIN_UP_BOX align 192 + } + Fl_Button {} { + label Cancel + xywh {160 270 80 40} box THIN_UP_BOX align 192 + } + Fl_Box {} { + label {Type:} + xywh {10 5 45 20} align 20 + } + Fl_Box copytypetext {selected + xywh {50 5 200 20} box FLAT_BOX color 50 labelfont 1 align 20 + } + } + Fl_Window {} { + label {Paste from Clipboard/Preset} open + xywh {238 242 265 315} type Double hide modal + } { + Fl_Browser {} { + xywh {10 30 245 205} type Hold + } + Fl_Button {} { + label {Paste from Preset} + xywh {50 240 160 20} box THIN_UP_BOX + } + Fl_Button {} { + label {Paste from Clipboard} + xywh {25 270 90 40} box THIN_UP_BOX align 192 + } + Fl_Button {} { + label Cancel + xywh {160 270 80 40} box THIN_UP_BOX align 192 + } + Fl_Box {} { + label {Type:} + xywh {10 5 45 20} align 20 + } + Fl_Box pastetypetext { + xywh {50 5 200 20} box FLAT_BOX color 50 labelfont 1 align 20 + } + } + } +}