zynaddsubfx

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

commit 838157d3a1fa50c6be195b426ee4a9332259c07b
parent 8714947c7ee7d724692320cf920762b5ec52b42b
Author: paulnasca <paulnasca>
Date:   Wed, 18 Aug 2004 15:39:34 +0000

*** empty log message ***

Diffstat:
MChangeLog | 1+
Msrc/Misc/Buffer.C | 2++
Msrc/Misc/Microtonal.C | 2+-
Msrc/Misc/OldBank.C | 2++
Msrc/Misc/Part.C | 2+-
Msrc/Misc/XMLwrapper.C | 1+
Msrc/Misc/XMLwrapper.h | 2+-
Msrc/Params/ADnoteParameters.C | 22+++++++++++-----------
Msrc/Params/EnvelopeParams.C | 2+-
Msrc/Params/FilterParams.C | 2+-
Msrc/Params/SUBnoteParameters.C | 8++++----
Msrc/Synth/OscilGen.C | 1-
Msrc/Synth/Resonance.C | 2+-
13 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -691,6 +691,7 @@ 16 Aug 2004 - Corectata inca o eroare la pitch bend (aratata de Krzysztof Korpiela) - Adaugat refresh si la Filtru si paste la ADnote, SUBnote si PADsynth sunt complete 17 Aug 2004 - Adaugat clipboard la LFO, Envelope, ADnoteVoice si Filter Vowel +18 Aug 2004 - In clipboard se salveaza toti parametrii (chiar si cei dezactivati) \ No newline at end of file diff --git a/src/Misc/Buffer.C b/src/Misc/Buffer.C @@ -1,3 +1,5 @@ +//this file/class is obsolete and should be removed + /* ZynAddSubFX - a software synthesizer diff --git a/src/Misc/Microtonal.C b/src/Misc/Microtonal.C @@ -578,7 +578,7 @@ void Microtonal::add2XML(XMLwrapper *xml){ xml->addpar("a_note",PAnote); xml->addparreal("a_freq",PAfreq); - if (Penabled==0) return; + if ((Penabled==0)&&(xml->minimal)) return; xml->beginbranch("SCALE"); xml->addpar("scale_shift",Pscaleshift); diff --git a/src/Misc/OldBank.C b/src/Misc/OldBank.C @@ -1,3 +1,5 @@ +//this file/class is obsolete and should be removed + /* ZynAddSubFX - a software synthesizer diff --git a/src/Misc/Part.C b/src/Misc/Part.C @@ -1012,7 +1012,7 @@ void Part::add2XMLinstrument(XMLwrapper *xml){ void Part::add2XML(XMLwrapper *xml){ //parameters xml->addparbool("enabled",Penabled); - if (Penabled==0) return; + if ((Penabled==0)&&(xml->minimal)) return; xml->addpar("volume",Pvolume); xml->addpar("panning",Ppanning); diff --git a/src/Misc/XMLwrapper.C b/src/Misc/XMLwrapper.C @@ -68,6 +68,7 @@ XMLwrapper::XMLwrapper(){ ZERO(&parentstack,(int)sizeof(parentstack)); ZERO(&values,(int)sizeof(values)); + minimal=false; stackpos=0; tree=mxmlNewElement(MXML_NO_PARENT,"?xml"); diff --git a/src/Misc/XMLwrapper.h b/src/Misc/XMLwrapper.h @@ -108,7 +108,7 @@ class XMLwrapper{ REALTYPE getparreal(char *name,REALTYPE defaultpar); REALTYPE getparreal(char *name,REALTYPE defaultpar,REALTYPE min,REALTYPE max); - + bool minimal;//false if all parameters will be stored (used only for clipboard) private: int dosavefile(char *filename,int compression,char *xmldata); diff --git a/src/Params/ADnoteParameters.C b/src/Params/ADnoteParameters.C @@ -530,7 +530,7 @@ void ADnoteParameters::add2XMLsection(XMLwrapper *xml,int n){ }; xml->addparbool("enabled",VoicePar[nvoice].Enabled); - if ((VoicePar[nvoice].Enabled==0)&&(oscilused==0)&&(fmoscilused==0)) return; + if (((VoicePar[nvoice].Enabled==0)&&(oscilused==0)&&(fmoscilused==0))&&(xml->minimal)) return; xml->addpar("type",VoicePar[nvoice].Type); xml->addpar("delay",VoicePar[nvoice].PDelay); @@ -559,13 +559,13 @@ void ADnoteParameters::add2XMLsection(XMLwrapper *xml,int n){ xml->addpar("velocity_sensing",VoicePar[nvoice].PAmpVelocityScaleFunction); xml->addparbool("amp_envelope_enabled",VoicePar[nvoice].PAmpEnvelopeEnabled); - if (VoicePar[nvoice].PAmpEnvelopeEnabled!=0){ + if ((VoicePar[nvoice].PAmpEnvelopeEnabled!=0)||(!xml->minimal)){ xml->beginbranch("AMPLITUDE_ENVELOPE"); VoicePar[nvoice].AmpEnvelope->add2XML(xml); xml->endbranch(); }; xml->addparbool("amp_lfo_enabled",VoicePar[nvoice].PAmpLfoEnabled); - if (VoicePar[nvoice].PAmpLfoEnabled!=0){ + if ((VoicePar[nvoice].PAmpLfoEnabled!=0)||(!xml->minimal)){ xml->beginbranch("AMPLITUDE_LFO"); VoicePar[nvoice].AmpLfo->add2XML(xml); xml->endbranch(); @@ -580,13 +580,13 @@ void ADnoteParameters::add2XMLsection(XMLwrapper *xml,int n){ xml->addpar("detune_type",VoicePar[nvoice].PDetuneType); xml->addparbool("freq_envelope_enabled",VoicePar[nvoice].PFreqEnvelopeEnabled); - if (VoicePar[nvoice].PFreqEnvelopeEnabled!=0){ + if ((VoicePar[nvoice].PFreqEnvelopeEnabled!=0)||(!xml->minimal)){ xml->beginbranch("FREQUENCY_ENVELOPE"); VoicePar[nvoice].FreqEnvelope->add2XML(xml); xml->endbranch(); }; xml->addparbool("freq_lfo_enabled",VoicePar[nvoice].PFreqLfoEnabled); - if (VoicePar[nvoice].PFreqLfoEnabled!=0){ + if ((VoicePar[nvoice].PFreqLfoEnabled!=0)||(!xml->minimal)){ xml->beginbranch("FREQUENCY_LFO"); VoicePar[nvoice].FreqLfo->add2XML(xml); xml->endbranch(); @@ -594,21 +594,21 @@ void ADnoteParameters::add2XMLsection(XMLwrapper *xml,int n){ xml->endbranch(); - if (VoicePar[nvoice].PFilterEnabled!=0){ + if ((VoicePar[nvoice].PFilterEnabled!=0)||(!xml->minimal)){ xml->beginbranch("FILTER_PARAMETERS"); xml->beginbranch("FILTER"); VoicePar[nvoice].VoiceFilter->add2XML(xml); xml->endbranch(); xml->addparbool("filter_envelope_enabled",VoicePar[nvoice].PFilterEnvelopeEnabled); - if (VoicePar[nvoice].PFilterEnvelopeEnabled!=0){ + if ((VoicePar[nvoice].PFilterEnvelopeEnabled!=0)||(!xml->minimal)){ xml->beginbranch("FILTER_ENVELOPE"); VoicePar[nvoice].FilterEnvelope->add2XML(xml); xml->endbranch(); }; xml->addparbool("filter_lfo_enabled",VoicePar[nvoice].PFilterLfoEnabled); - if (VoicePar[nvoice].PFilterLfoEnabled!=0){ + if ((VoicePar[nvoice].PFilterLfoEnabled!=0)||(!xml->minimal)){ xml->beginbranch("FILTER_LFO"); VoicePar[nvoice].FilterLfo->add2XML(xml); xml->endbranch(); @@ -616,7 +616,7 @@ void ADnoteParameters::add2XMLsection(XMLwrapper *xml,int n){ xml->endbranch(); }; - if ((VoicePar[nvoice].PFMEnabled!=0)||(fmoscilused!=0)){ + if ((VoicePar[nvoice].PFMEnabled!=0)||(fmoscilused!=0)||(!xml->minimal)){ xml->beginbranch("FM_PARAMETERS"); xml->addpar("input_voice",VoicePar[nvoice].PFMVoice); @@ -625,7 +625,7 @@ void ADnoteParameters::add2XMLsection(XMLwrapper *xml,int n){ xml->addpar("velocity_sensing",VoicePar[nvoice].PFMVelocityScaleFunction); xml->addparbool("amp_envelope_enabled",VoicePar[nvoice].PFMAmpEnvelopeEnabled); - if (VoicePar[nvoice].PFMAmpEnvelopeEnabled!=0){ + if ((VoicePar[nvoice].PFMAmpEnvelopeEnabled!=0)||(!xml->minimal)){ xml->beginbranch("AMPLITUDE_ENVELOPE"); VoicePar[nvoice].FMAmpEnvelope->add2XML(xml); xml->endbranch(); @@ -636,7 +636,7 @@ void ADnoteParameters::add2XMLsection(XMLwrapper *xml,int n){ xml->addpar("detune_type",VoicePar[nvoice].PFMDetuneType); xml->addparbool("freq_envelope_enabled",VoicePar[nvoice].PFMFreqEnvelopeEnabled); - if (VoicePar[nvoice].PFMFreqEnvelopeEnabled!=0){ + if ((VoicePar[nvoice].PFMFreqEnvelopeEnabled!=0)||(!xml->minimal)){ xml->beginbranch("FREQUENCY_ENVELOPE"); VoicePar[nvoice].FMFreqEnvelope->add2XML(xml); xml->endbranch(); diff --git a/src/Params/EnvelopeParams.C b/src/Params/EnvelopeParams.C @@ -233,7 +233,7 @@ void EnvelopeParams::add2XML(XMLwrapper *xml){ xml->addpar("S_val",PS_val); xml->addpar("R_val",PR_val); - if (Pfreemode!=0){ + if ((Pfreemode!=0)||(!xml->minimal)){ for (int i=0;i<Penvpoints;i++){ xml->beginbranch("POINT",i); if (i!=0) xml->addpar("dt",Penvdt[i]); diff --git a/src/Params/FilterParams.C b/src/Params/FilterParams.C @@ -376,7 +376,7 @@ void FilterParams::add2XML(XMLwrapper *xml){ xml->addpar("gain",Pgain); //formant filter parameters - if (Pcategory==1){ + if ((Pcategory==1)||(!xml->minimal)){ xml->beginbranch("FORMANT_FILTER"); xml->addpar("num_formants",Pnumformants); xml->addpar("formant_slowness",Pformantslowness); diff --git a/src/Params/SUBnoteParameters.C b/src/Params/SUBnoteParameters.C @@ -216,7 +216,7 @@ void SUBnoteParameters::add2XML(XMLwrapper *xml){ xml->beginbranch("HARMONICS"); for (int i=0;i<MAX_SUB_HARMONICS;i++){ - if (Phmag[i]==0) continue; + if ((Phmag[i]==0)&&(xml->minimal)) continue; xml->beginbranch("HARMONIC",i); xml->addpar("mag",Phmag[i]); xml->addpar("relbw",Phrelbw[i]); @@ -246,14 +246,14 @@ void SUBnoteParameters::add2XML(XMLwrapper *xml){ xml->addpar("bandwidth_scale",Pbwscale); xml->addparbool("freq_envelope_enabled",PFreqEnvelopeEnabled); - if (PFreqEnvelopeEnabled!=0){ + if ((PFreqEnvelopeEnabled!=0)||(!xml->minimal)){ xml->beginbranch("FREQUENCY_ENVELOPE"); FreqEnvelope->add2XML(xml); xml->endbranch(); }; xml->addparbool("band_width_envelope_enabled",PBandWidthEnvelopeEnabled); - if (PBandWidthEnvelopeEnabled!=0){ + if ((PBandWidthEnvelopeEnabled!=0)||(!xml->minimal)){ xml->beginbranch("BANDWIDTH_ENVELOPE"); BandWidthEnvelope->add2XML(xml); xml->endbranch(); @@ -262,7 +262,7 @@ void SUBnoteParameters::add2XML(XMLwrapper *xml){ xml->beginbranch("FILTER_PARAMETERS"); xml->addparbool("enabled",PGlobalFilterEnabled); - if (PGlobalFilterEnabled!=0){ + if ((PGlobalFilterEnabled!=0)||(!xml->minimal)){ xml->beginbranch("FILTER"); GlobalFilter->add2XML(xml); xml->endbranch(); diff --git a/src/Synth/OscilGen.C b/src/Synth/OscilGen.C @@ -1284,7 +1284,6 @@ void OscilGen::add2XML(XMLwrapper *xml){ void OscilGen::getfromXML(XMLwrapper *xml){ Phmagtype=xml->getpar127("harmonic_mag_type",Phmagtype); -// Pnormalizemethod=xml->getpar127("normalize_method",Pnormalizemethod); Pcurrentbasefunc=xml->getpar127("base_function",Pcurrentbasefunc); Pbasefuncpar=xml->getpar127("base_function_par",Pbasefuncpar); diff --git a/src/Synth/Resonance.C b/src/Synth/Resonance.C @@ -257,7 +257,7 @@ void Resonance::saveloadbuf(Buffer *buf){ void Resonance::add2XML(XMLwrapper *xml){ xml->addparbool("enabled",Penabled); - if (Penabled==0) return; + if ((Penabled==0)&&(xml->minimal)) return; xml->addpar("max_db",PmaxdB); xml->addpar("center_freq",Pcenterfreq);