From effa3861bee2f7e64bc5a74a007d411360961163 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 24 Sep 2009 21:21:38 +0300 Subject: [PATCH] Small enhancements and bugfixes to Unison (cherry picked from commit 1f30a453df88c9a508bd54b0b9d06192a0c10ddc) --- plugins/zynaddsubfx/ChangeLog | 7 +++++-- .../zynaddsubfx/src/Params/ADnoteParameters.cpp | 16 +++++++++++----- plugins/zynaddsubfx/src/Synth/ADnote.cpp | 7 +++---- plugins/zynaddsubfx/src/UI/ADnoteUI.fl | 8 ++++---- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/plugins/zynaddsubfx/ChangeLog b/plugins/zynaddsubfx/ChangeLog index 6dd0e07fb..9bc8ffc7c 100644 --- a/plugins/zynaddsubfx/ChangeLog +++ b/plugins/zynaddsubfx/ChangeLog @@ -1,4 +1,4 @@ -6 Mar 2002 -(dupamasa - in jur de ora 4) Mi-a venit ideea exact cum sa fac cand ma plimbam pe strada Rolirudnap +6 Mar 2002 -(dupamasa - in jur de ora 4) Mi-a venit ideea exact cum sa fac cand ma plimbam pe strada Pandurilor 7/8 Mar 2002 - Started to do diagrams 10 Mar 2002 - Started to write "voice" 11 Mar 2002 - Heard first sound @@ -903,4 +903,7 @@ - Added unison invert phase - Made unison frequency spread to depend on Bandwidth controllers and parameters - Added unison vibratto speed control and other improvements - - bugfixes: Voice Amplitude Envelope and FM \ No newline at end of file + - bugfixes: Voice Amplitude Envelope and FM + +24 Sep 2009 (Paul Nasca) + - Small enhancements and bugfixes to Unison \ No newline at end of file diff --git a/plugins/zynaddsubfx/src/Params/ADnoteParameters.cpp b/plugins/zynaddsubfx/src/Params/ADnoteParameters.cpp index 58c901392..87e78bf41 100644 --- a/plugins/zynaddsubfx/src/Params/ADnoteParameters.cpp +++ b/plugins/zynaddsubfx/src/Params/ADnoteParameters.cpp @@ -99,7 +99,7 @@ void ADnoteParameters::defaults(int n) VoicePar[nvoice].Enabled=0; VoicePar[nvoice].Unison_size=1; - VoicePar[nvoice].Unison_frequency_spread=30; + VoicePar[nvoice].Unison_frequency_spread=60; VoicePar[nvoice].Unison_stereo_spread=64; VoicePar[nvoice].Unison_vibratto=64; VoicePar[nvoice].Unison_vibratto_speed=64; @@ -206,7 +206,7 @@ REALTYPE ADnoteParameters::getBandwidthDetuneMultiplier() REALTYPE ADnoteParameters::getUnisonFrequencySpreadCents(int nvoice){ REALTYPE unison_spread=VoicePar[nvoice].Unison_frequency_spread/127.0; - unison_spread=pow(unison_spread*2.0,2.0)*100.0;//cents + unison_spread=pow(unison_spread*2.0,2.0)*50.0;//cents return unison_spread; }; @@ -253,8 +253,14 @@ int ADnoteParameters::get_unison_size_index(int nvoice){ int index=0; if (nvoice>=NUM_VOICES) return 0; int unison=VoicePar[nvoice].Unison_size; - while(1){ - if ((ADnote_unison_sizes[index]<=unison)||(ADnote_unison_sizes[index]==0)) return index; + + while(1){ + if (ADnote_unison_sizes[index]>=unison) { + return index; + }; + if (ADnote_unison_sizes[index]==0) { + return index-1; + }; index++; }; return 0; @@ -581,7 +587,7 @@ void ADnoteParameters::getfromXMLsection(XMLwrapper *xml,int n) VoicePar[nvoice].Unison_stereo_spread=xml->getpar127("unison_stereo_spread",VoicePar[nvoice].Unison_stereo_spread); VoicePar[nvoice].Unison_vibratto=xml->getpar127("unison_vibratto",VoicePar[nvoice].Unison_vibratto); VoicePar[nvoice].Unison_vibratto_speed=xml->getpar127("unison_vibratto_speed",VoicePar[nvoice].Unison_vibratto_speed); - VoicePar[nvoice].Unison_invert_phase=xml->getpar127("Unison_invert_phase",VoicePar[nvoice].Unison_invert_phase); + VoicePar[nvoice].Unison_invert_phase=xml->getpar127("unison_invert_phase",VoicePar[nvoice].Unison_invert_phase); VoicePar[nvoice].Type=xml->getpar127("type",VoicePar[nvoice].Type); VoicePar[nvoice].PDelay=xml->getpar127("delay",VoicePar[nvoice].PDelay); diff --git a/plugins/zynaddsubfx/src/Synth/ADnote.cpp b/plugins/zynaddsubfx/src/Synth/ADnote.cpp index 20ee83a19..ae319d2bc 100644 --- a/plugins/zynaddsubfx/src/Synth/ADnote.cpp +++ b/plugins/zynaddsubfx/src/Synth/ADnote.cpp @@ -134,7 +134,7 @@ ADnote::ADnote(ADnoteParameters *pars,Controller *ctl_,REALTYPE freq,REALTYPE ve REALTYPE diff=max-min; for (int k=0;kVoicePar[nvoice].Unison_vibratto_speed/127.0)*4.0); for (int k=0;kredraw();} open } { Fl_Dial {} { label Stereo - callback {pars->VoicePar[nvoice].Unison_stereo_spread=(int)o->value();} selected + callback {pars->VoicePar[nvoice].Unison_stereo_spread=(int)o->value();} tooltip {Stereo Spread} xywh {285 540 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1 code0 {o->value(pars->VoicePar[nvoice].Unison_stereo_spread);} class WidgetPDial } Fl_Choice {} { label Unison - callback {pars->set_unison_size_index(nvoice,(int) o->value());} open + callback {pars->set_unison_size_index(nvoice,(int) o->value());} open selected tooltip {Unison size} xywh {10 545 75 20} down_box BORDER_BOX labelfont 1 align 5 textfont 1 textsize 10 code0 {o->add("OFF");char tmp[100];for (int i=1;ADnote_unison_sizes[i];i++){snprintf(tmp,100,"size %d",ADnote_unison_sizes[i]);o->add(tmp);};} - code1 {o->value(pars->VoicePar[nvoice].PDetuneType);} + code1 {o->value(pars->get_unison_size_index(nvoice));} } {} Fl_Dial {} { label Vibratto