zynaddsubfx

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

commit f92c00891c63722974d94dd80b1755f215e88857
parent 37e377f68a44ff77468b242e07274319a21c3f6b
Author: Christopher A. Oliver <caowasteland@gmail.com>
Date:   Wed, 25 Nov 2015 01:27:20 -0500

Try to give decent reset value for dials and sliders.
Nothing for LFO, Envelopes, Filters, and Effects as they
occur in different contexts.  What's a reasonable default.

Diffstat:
Msrc/UI/ADnoteUI.fl | 48++++++++++++++++++++++++------------------------
Msrc/UI/Fl_Osc_TSlider.H | 2+-
Msrc/UI/Fl_Osc_TSlider.cpp | 6+++---
Msrc/UI/MasterUI.fl | 12++++++------
Msrc/UI/OscilGenUI.fl | 26+++++++++++++-------------
Msrc/UI/PADnoteUI.fl | 34+++++++++++++++++-----------------
Msrc/UI/PartUI.fl | 30+++++++++++++++---------------
Msrc/UI/ResonanceUI.fl | 4++--
Msrc/UI/SUBnoteUI.fl | 12++++++------
Msrc/UI/TipWin.cpp | 2+-
Msrc/UI/TipWin.h | 2+-
Msrc/UI/WidgetPDial.cpp | 60+++++++++++++++++++++++++++++++++---------------------------
Msrc/UI/WidgetPDial.h | 3++-
13 files changed, 124 insertions(+), 117 deletions(-)

diff --git a/src/UI/ADnoteUI.fl b/src/UI/ADnoteUI.fl @@ -87,7 +87,7 @@ class PhaseSlider {: {public Fl_Osc_TSlider} Function {PhaseSlider(int x,int y, int w, int h, const char *label=0) :Fl_Osc_TSlider(x,y,w,h,label)} {open } { code { - setRounding(1); + set_rounding(1); reset_value=0; setTransform(180.0/64, 0); } {}} @@ -127,7 +127,7 @@ class ADvoicelistitem {open : {public Fl_Osc_Group} } { Fl_Value_Slider voicevolume { tooltip Volume xywh {132 5 115 20} type {Horz Knob} box NO_BOX labelsize 8 align 5 maximum 127 step 1 - code1 {o->init("PVolume");} + code1 {o->init("PVolume"); o->reset_value=100;} class Fl_Osc_VSlider } Fl_Check_Button voiceresonanceenabled { @@ -137,12 +137,12 @@ class ADvoicelistitem {open : {public Fl_Osc_Group} } Fl_Value_Slider voicelfofreq { tooltip {Frequency LFO amount} xywh {542 5 115 20} type {Horz Knob} box NO_BOX labelsize 8 align 5 maximum 127 step 1 - code0 {o->init("FreqLfo/Pintensity", 'i');} + code0 {o->init("FreqLfo/Pintensity", 'i');o->reset_value=40;} class Fl_Osc_VSlider } Fl_Dial voicepanning { tooltip {Panning (leftmost is Random)} xywh {257 5 20 20} box ROUND_UP_BOX labelsize 10 align 4 maximum 127 step 1 - code0 {o->init("PPanning");} + code0 {o->init("PPanning");o->reset_value=64;} class Fl_Osc_Dial } Fl_Group voiceoscil {open @@ -380,13 +380,13 @@ o->redraw();} Fl_Value_Slider {} { label Vol tooltip Volume xywh {540 80 155 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1 - code0 {o->init("PFMVolume", 'i');} + code0 {o->init("PFMVolume", 'i');o->reset_value=90;} class Fl_Osc_VSlider } Fl_Value_Slider {} { label {V.Sns} tooltip {Velocity Sensing Function (rightmost to disable)} xywh {540 100 160 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1 - code0 {o->init("PFMVelocityScaleFunction");} + code0 {o->init("PFMVelocityScaleFunction");o->reset_value=64;} class Fl_Osc_VSlider } Fl_Group voiceFMampenvgroup { @@ -564,8 +564,8 @@ o->redraw();} } Fl_Dial bendadjdial { label {Bend Adj.} - tooltip {How the frequency varies according to the pitch wheel} xywh {64 270 15 15} box ROUND_UP_BOX labelsize 10 align 8 maximum 127 step 1 - code0 {o->init("PBendAdjust");} + tooltip {How the frequency varies according to the pitch wheel} xywh {64 270 15 15} box ROUND_UP_BOX labelsize 10 align 8 minimum -64 maximum 63 step 1 + code0 {o->init("PBendAdjust");o->reset_value=24;o->set_transform(1.0/24, 0);o->set_rounding(2);} class Fl_Osc_Dial } Fl_Slider {} { @@ -664,7 +664,7 @@ voiceonbutton->redraw();} open Fl_Dial {} { label Vibrato tooltip Vibrato xywh {364 555 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1 - code0 {o->init("Unison_vibratto");} + code0 {o->init("Unison_vibratto");o->reset_value=64;} class Fl_Osc_Dial } Fl_Choice {} { @@ -678,7 +678,7 @@ voiceonbutton->redraw();} open label {Frequency Spread} callback {unisonspreadoutput->update();} tooltip {Frequency Spread of the Unison} xywh {95 562 125 13} type {Horz Knob} box NO_BOX labelsize 12 align 1 maximum 127 step 1 value 64 - code0 {o->init("Unison_frequency_spread", 'i');} + code0 {o->init("Unison_frequency_spread", 'i');o->reset_value=60;} class Fl_Osc_Slider } Fl_Value_Output unisonspreadoutput { @@ -690,19 +690,19 @@ voiceonbutton->redraw();} open Fl_Dial {} { label {V.speed} tooltip {Vibrato Average Speed} xywh {406 555 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1 - code0 {o->init("Unison_vibratto_speed");} + code0 {o->init("Unison_vibratto_speed");o->reset_value=64;} class Fl_Osc_Dial } Fl_Dial {} { label {Ph.rand} tooltip {Phase randomness} xywh {280 555 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1 - code0 {o->init("Unison_phase_randomness");} + code0 {o->init("Unison_phase_randomness");o->reset_value=127;} class Fl_Osc_Dial } Fl_Dial {} { label Stereo tooltip {Stereo Spread} xywh {322 555 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1 - code0 {o->init("Unison_stereo_spread");} + code0 {o->init("Unison_stereo_spread");o->reset_value=64;} class Fl_Osc_Dial } } @@ -714,13 +714,13 @@ voiceonbutton->redraw();} open Fl_Value_Slider {} { label Vol tooltip Volume xywh {10 60 160 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1 - code0 {o->init("PVolume");} + code0 {o->init("PVolume");o->reset_value=100;} class Fl_Osc_VSlider } Fl_Value_Slider {} { label {V.Sns} tooltip {Velocity Sensing Function (rightmost to disable)} xywh {10 80 160 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1 - code0 {o->init("PAmpVelocityScaleFunction");} + code0 {o->init("PAmpVelocityScaleFunction");o->reset_value=127;} class Fl_Osc_VSlider } Fl_Group voiceampenvgroup { @@ -733,7 +733,7 @@ voiceonbutton->redraw();} open Fl_Dial {} { label Pan tooltip {Panning (leftmost is Random)} xywh {212 65 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1 - code0 {o->init("PPanning");} + code0 {o->init("PPanning");o->reset_value=64;} class Fl_Osc_Dial } Fl_Check_Button {} { @@ -1029,7 +1029,7 @@ class ADnoteUI {open : {public PresetsUI_} voicelistitem[i]->refreshlist(); };} tooltip {Bandwidth - how the relative fine detune of the voice are changed} xywh {505 295 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1 - code0 {o->init("PBandwidth");} + code0 {o->init("PBandwidth");o->reset_value=64;} class Fl_Osc_Dial } } @@ -1040,25 +1040,25 @@ class ADnoteUI {open : {public PresetsUI_} Fl_Value_Slider volume { label Vol tooltip Volume xywh {10 30 160 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1 - code0 {o->init("PVolume");} + code0 {o->init("PVolume");o->reset_value=90;} class Fl_Osc_VSlider } Fl_Value_Slider vsns { label {V.Sns} tooltip {Velocity Sensing Function (rightmost to disable)} xywh {10 50 160 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1 - code0 {o->init("PAmpVelocityScaleFunction");} + code0 {o->init("PAmpVelocityScaleFunction");o->reset_value=64;} class Fl_Osc_VSlider } Fl_Dial pan { label Pan tooltip {Panning (leftmost is Random)} xywh {210 25 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1 - code0 {o->init("PPanning");} + code0 {o->init("PPanning");o->reset_value=64;} class Fl_Osc_Dial } Fl_Dial {} { label De-pop selected tooltip {Pop suppression} xywh {208 228 20 20} type Float labelsize 10 maximum 127 step 1 textfont 1 textsize 11 - code0 {o->init("Fadein_adjustment");} + code0 {o->init("Fadein_adjustment");o->reset_value=20;} class Fl_Osc_Dial } @@ -1071,19 +1071,19 @@ class ADnoteUI {open : {public PresetsUI_} Fl_Dial pt { label {P.t.} tooltip {Punch Time (duration)} xywh {108 237 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1 - code0 {o->init("PPunchTime");} + code0 {o->init("PPunchTime");o->reset_value=60;} class Fl_Osc_Dial } Fl_Dial pstc { label {P.Stc.} tooltip {Punch Stretch} xywh {138 237 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1 - code0 {o->init("PPunchStretch");} + code0 {o->init("PPunchStretch");o->reset_value=64;} class Fl_Osc_Dial } Fl_Dial pvel { label {P.Vel.} tooltip {Punch Velocity Sensing} xywh {168 237 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1 - code0 {o->init("PPunchVelocitySensing");} + code0 {o->init("PPunchVelocitySensing");o->reset_value=72;} class Fl_Osc_Dial } Fl_Group ampenv { diff --git a/src/UI/Fl_Osc_TSlider.H b/src/UI/Fl_Osc_TSlider.H @@ -12,7 +12,7 @@ class Fl_Osc_TSlider:public Fl_Osc_Slider int handle(int event); void setTransform(float scale = 1.0, float offset = 0.0); float transform(float x); - void setRounding(unsigned int digits = 0); + void set_rounding(unsigned int digits = 0); private: class TipWin * tipwin; float value_offset; diff --git a/src/UI/Fl_Osc_TSlider.cpp b/src/UI/Fl_Osc_TSlider.cpp @@ -11,7 +11,7 @@ Fl_Osc_TSlider::Fl_Osc_TSlider(int x, int y, int w, int h, const char *label) tipwin = new TipWin(); tipwin->hide(); Fl_Group::current(save); - tipwin->setRounding(); + tipwin->set_rounding(); } Fl_Osc_TSlider::~Fl_Osc_TSlider() @@ -20,9 +20,9 @@ Fl_Osc_TSlider::~Fl_Osc_TSlider() delete tipwin; } -void Fl_Osc_TSlider::setRounding(unsigned int digits) +void Fl_Osc_TSlider::set_rounding(unsigned int digits) { - tipwin->setRounding(digits); + tipwin->set_rounding(digits); } diff --git a/src/UI/MasterUI.fl b/src/UI/MasterUI.fl @@ -148,7 +148,7 @@ bankui->show();} } Fl_Slider partvolume { xywh {10 65 30 110} type {Vert Knob} box NO_BOX minimum 127 maximum 0 step 1 value 127 - code0 {o->init("Pvolume", 'i');} + code0 {o->init("Pvolume", 'i');o->reset_value=96;} class Fl_Osc_TSlider } Fl_Dial partpanning { @@ -508,7 +508,7 @@ if (fl_choice("The file *might* exist. \\nOverwrite it?","No","Yes",NULL)) { Fl_Dial mastervolumedial { label {Master Volume} tooltip {Master Volume} xywh {15 32 55 55} box ROUND_UP_BOX labelsize 9 align 130 maximum 127 step 1 - code2 {o->init("volume"); o->selection_color(FL_RED);} + code2 {o->init("volume"); o->selection_color(FL_RED); o->reset_value=80;} class Fl_Osc_Dial } Fl_Counter masterkeyshiftcounter { @@ -856,7 +856,7 @@ globalfinedetuneslider->do_callback();} Fl_Dial globalfinedetuneslider { label {Fine Detune} tooltip {global fine detune} xywh {90 68 45 45} box ROUND_UP_BOX labelsize 9 align 130 maximum 127 step 1 value 64 - code0 {o->init("microtonal/Pglobalfinedetune");} + code0 {o->init("microtonal/Pglobalfinedetune");o->reset_value=64;} class Fl_Osc_Dial } } @@ -1102,7 +1102,7 @@ virkeys->midich=(int) o->value();} open } {} Fl_Dial partvolume { xywh {135 95 45 40} labelsize 9 maximum 127 step 1 - code0 {o->init("Pvolume");} + code0 {o->init("Pvolume"); o->reset_value=96;} class Fl_Osc_Dial } Fl_Box {} { @@ -1422,7 +1422,7 @@ pthread_mutex_unlock(&master->mutex);*/} Fl_Dial simplemastervolumedial { label {Master Volume} tooltip {Master Volume} xywh {10 35 40 40} box ROUND_UP_BOX labelfont 1 labelsize 11 align 130 maximum 127 step 1 - code0 {o->init("Pvolume");} + code0 {o->init("Pvolume");o->reset_value=80;} class Fl_Osc_Dial } Fl_Counter simplemasterkeyshiftcounter { @@ -1448,7 +1448,7 @@ simpleglobalfinedetuneslider->do_callback();} Fl_Dial simpleglobalfinedetuneslider { label {Fine Detune} tooltip {global fine detune} xywh {80 50 30 30} box ROUND_UP_BOX labelsize 11 align 130 maximum 127 step 1 value 64 - code0 {o->init("microtonal/Pglobalfinedetune");} + code0 {o->init("microtonal/Pglobalfinedetune");o->reset_value=64;} class Fl_Osc_Dial } Fl_Counter simplenpartcounter { diff --git a/src/UI/OscilGenUI.fl b/src/UI/OscilGenUI.fl @@ -199,7 +199,7 @@ mag->setTransform(-1, 63); phase->osc = osc; phase->loc = loc; phase->reset_value = 64; -phase->setRounding(1); +phase->set_rounding(1); phase->setTransform(-180.0/64, 180.0); osc->createLink(loc+"magnitude"+to_s(n), mag); @@ -303,7 +303,7 @@ class OscilEditor {open : {public PresetsUI_} } Fl_Dial hrnddial { tooltip {Oscillator's spectrum adjust parameter} xywh {345 285 18 18} maximum 127 step 1 - code0 {o->init("Pamprandpower");} + code0 {o->init("Pamprandpower");o->reset_value=64;} class Fl_Osc_Dial } } @@ -485,19 +485,19 @@ redrawoscil();} Fl_Dial bfmodpar1 { callback {redrawoscil();} tooltip {Oscillator's modulation parameter 1} xywh {664 286 15 15} maximum 127 step 1 - code0 {o->init("Pbasefuncmodulationpar1");} + code0 {o->init("Pbasefuncmodulationpar1");o->reset_value=64;} class Fl_Osc_Dial } Fl_Dial bfmodpar2 { callback {redrawoscil();} tooltip {Oscillator's modulation parameter 2} xywh {684 286 15 15} maximum 127 step 1 - code0 {o->init("Pbasefuncmodulationpar2");} + code0 {o->init("Pbasefuncmodulationpar2");o->reset_value=64;} class Fl_Osc_Dial } Fl_Dial bfmodpar3 { callback {redrawoscil();} selected tooltip {Oscillator's modulation parameter 3} xywh {704 286 15 15} maximum 127 step 1 - code0 {o->init("Pbasefuncmodulationpar3");} + code0 {o->init("Pbasefuncmodulationpar3");o->reset_value=32;} class Fl_Osc_Dial } } @@ -718,7 +718,7 @@ redrawoscil();} Fl_Dial filtervalue1 { callback {redrawoscil();} tooltip {Oscillator's filter parameter1} xywh {372 318 20 20} maximum 127 step 1 - code0 {o->init("Pfilterpar1");} + code0 {o->init("Pfilterpar1");o->reset_value=64;} class Fl_Osc_Dial } Fl_Check_Button filterpref { @@ -729,7 +729,7 @@ redrawoscil();} Fl_Dial filtervalue2 { callback {redrawoscil();} tooltip {Oscillator's filter parameter2} xywh {395 318 20 20} maximum 127 step 1 - code0 {o->init("Pfilterpar2");} + code0 {o->init("Pfilterpar2");o->reset_value=64;} class Fl_Osc_Dial } } @@ -763,7 +763,7 @@ redrawoscil();} Fl_Dial sadjpar { callback {redrawoscil();} tooltip {Oscillator's spectrum adjust parameter} xywh {700 318 20 20} maximum 127 step 1 - code0 {o->init("Psapar");} + code0 {o->init("Psapar");o->reset_value=64;} class Fl_Osc_Dial } } @@ -843,14 +843,14 @@ redrawoscil();} label pow callback {redrawoscil();} tooltip {Adaptive harmonics power} xywh {705 465 25 25} labelsize 10 maximum 200 step 1 - code0 {o->init("Padaptiveharmonicspower");} + code0 {o->init("Padaptiveharmonicspower");o->reset_value=100;} class Fl_Osc_Dial } Fl_Dial adhrbf { label baseF callback {redrawoscil();} tooltip {Adaptive harmonics base frequency} xywh {675 465 25 25} labelsize 10 maximum 255 step 1 - code0 {o->init("Padaptiveharmonicsbasefreq");} + code0 {o->init("Padaptiveharmonicsbasefreq");o->reset_value=128;} class Fl_Osc_Dial } Fl_Slider adhrpar { @@ -890,19 +890,19 @@ redrawoscil();} Fl_Dial modpar1 { callback {redrawoscil();} tooltip {Oscillator's modulation parameter 1} xywh {535 320 15 15} maximum 127 step 1 - code0 {o->init("Pmodulationpar1");} + code0 {o->init("Pmodulationpar1");o->reset_value=64;} class Fl_Osc_Dial } Fl_Dial modpar2 { callback {redrawoscil();} tooltip {Oscillator's modulation parameter 2} xywh {555 320 15 15} maximum 127 step 1 - code0 {o->init("Pmodulationpar2");} + code0 {o->init("Pmodulationpar2");o->reset_value=64;} class Fl_Osc_Dial } Fl_Dial modpar3 { callback {redrawoscil();} tooltip {Oscillator's modulation parameter 3} xywh {575 320 15 15} maximum 127 step 1 - code0 {o->init("Pmodulationpar3");} + code0 {o->init("Pmodulationpar3");o->reset_value=32;} class Fl_Osc_Dial } } diff --git a/src/UI/PADnoteUI.fl b/src/UI/PADnoteUI.fl @@ -136,7 +136,7 @@ initialized = true;} {} callback {if(hpui) hpui->update(); cbwidget->do_callback();} xywh {20 75 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1 - code2 {o->init("Php.base.par1");} + code2 {o->init("Php.base.par1");o->reset_value=80;} class Fl_Osc_Dial } Fl_Choice hpbasetype { @@ -182,7 +182,7 @@ cbwidget->do_callback();} callback {hpui->update(); cbwidget->do_callback();} xywh {40 115 20 20} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1 - code0 {o->init("Php.modulator.freq");} + code0 {o->init("Php.modulator.freq");o->reset_value=30;} class Fl_Osc_Dial } Fl_Group {} { @@ -244,7 +244,7 @@ cbwidget->do_callback();}} callback {hpui->update(); cbwidget->do_callback();} xywh {15 235 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1 - code0 {o->init("Php.amp.par1");} + code0 {o->init("Php.amp.par1");o->reset_value=80;} class Fl_Osc_Dial } Fl_Dial hpamppar2 { @@ -252,7 +252,7 @@ cbwidget->do_callback();} callback {hpui->update(); cbwidget->do_callback();} xywh {55 235 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1 - code0 {o->init("Php.amp.par2");} + code0 {o->init("Php.amp.par2");o->reset_value=64;} class Fl_Osc_Dial } } @@ -293,7 +293,7 @@ cbwidget->do_callback();}} callback {hpui->update(); cbwidget->do_callback();} xywh {65 115 20 20} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1 - code0 {o->init("Php.width");} + code0 {o->init("Php.width");o->reset_value=127;} class Fl_Osc_Dial } } @@ -328,7 +328,7 @@ resui->setcbwidget(cbwidget,applybutton);} label BandWidth callback {o->oscWrite("bandwidthvalue");cbwidget->do_callback();} xywh {15 295 35 35} box ROUND_UP_BOX labelsize 10 maximum 1000 step 1 - code0 {o->init("Pbandwidth");} + code0 {o->init("Pbandwidth");o->reset_value=500;} class Fl_Osc_Dial } Fl_Value_Output bwcents { @@ -387,7 +387,7 @@ cbwidget->do_callback();}} hpui->update(); cbwidget->do_callback();} xywh {425 310 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1 - code0 {o->init("Phrpos.par1");} + code0 {o->init("Phrpos.par1");o->reset_value=64;} class Fl_Osc_Dial } Fl_Dial hrpospar2 { @@ -395,7 +395,7 @@ cbwidget->do_callback();} callback {opui->update(); cbwidget->do_callback();} xywh {460 310 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1 - code0 {o->init("Phrpos.par2");} + code0 {o->init("Phrpos.par2");o->reset_value=64;} class Fl_Osc_Dial } Fl_Dial hrpospar3 { @@ -711,8 +711,8 @@ cbwidget->do_callback();} } {} Fl_Dial bendadjustdial { label {Bend Adj.} - tooltip {How the frequency varies according to the pitch wheel} xywh {60 278 15 15} box ROUND_UP_BOX labelsize 10 align 8 maximum 127 step 1 - code0 {o->init("PBendAdjust");} + tooltip {How the frequency varies according to the pitch wheel} xywh {60 278 15 15} box ROUND_UP_BOX labelsize 10 align 8 minimum -64 maximum 63 step 1 + code0 {o->init("PBendAdjust");o->reset_value=24;o->set_transform(1.0/24, 0);o->set_rounding(2);} class Fl_Osc_Dial } Fl_Check_Button hz440 { @@ -737,25 +737,25 @@ cbwidget->do_callback();} Fl_Value_Slider volume { label Vol tooltip Volume xywh {10 50 160 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1 - code0 {o->init("PVolume", 'i');} + code0 {o->init("PVolume", 'i');o->reset_value=90;} class Fl_Osc_VSlider } Fl_Value_Slider vsns { label {V.Sns} tooltip {Velocity Sensing Function (rightmost to disable)} xywh {10 70 160 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1 - code0 {o->init("PAmpVelocityScaleFunction");} + code0 {o->init("PAmpVelocityScaleFunction");o->reset_value=64;} class Fl_Osc_VSlider } Fl_Dial pan { label Pan tooltip {Panning (leftmost is Random)} xywh {210 45 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1 - code0 {o->init("PPanning");} + code0 {o->init("PPanning");o->reset_value=64;} class Fl_Osc_Dial } Fl_Dial {} { label De-pop selected tooltip {Pop suppression} xywh {208 238 20 20} type Float labelsize 10 maximum 127 step 1 textfont 1 textsize 11 - code0 {o->init("Fadein_adjustment");} + code0 {o->init("Fadein_adjustment");o->reset_value=20;} class Fl_Osc_Dial } Fl_Dial pstr { @@ -767,19 +767,19 @@ cbwidget->do_callback();} Fl_Dial pt { label {P.t.} tooltip {Punch Time (duration)} xywh {108 247 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1 - code0 {o->init("PPunchTime");} + code0 {o->init("PPunchTime");o->reset_value=60;} class Fl_Osc_Dial } Fl_Dial pstc { label {P.Stc.} tooltip {Punch Stretch} xywh {138 247 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1 - code0 {o->init("PPunchStretch");} + code0 {o->init("PPunchStretch");o->reset_value=64;} class Fl_Osc_Dial } Fl_Dial pvel { label {P.Vel.} tooltip {Punch Velocity Sensing} xywh {168 247 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1 - code0 {o->init("PPunchVelocitySensing");} + code0 {o->init("PPunchVelocitySensing");o->reset_value=72;} class Fl_Osc_Dial } Fl_Group ampenv { diff --git a/src/UI/PartUI.fl b/src/UI/PartUI.fl @@ -279,7 +279,7 @@ class PartUI {open : {public Fl_Osc_Group} Fl_Dial {} { label Pan xywh {50 40 25 25} box ROUND_UP_BOX labelsize 11 maximum 127 step 1 - code0 {o->init("Ppanning");} + code0 {o->init("Ppanning"); o->reset_value=64;} class Fl_Osc_Dial } Fl_Counter {} { @@ -344,19 +344,19 @@ if (event==FL_RIGHT_MOUSE){ Fl_Dial {} { label Volume tooltip {Part Volume} xywh {10 35 30 30} box ROUND_UP_BOX labelsize 11 maximum 127 step 1 - code0 {o->init("Pvolume");} + code0 {o->init("Pvolume"); o->reset_value=96;} class Fl_Osc_Dial } Fl_Dial {} { label {Vel.Ofs.} tooltip {Velocity Offset} xywh {135 40 25 25} box ROUND_UP_BOX labelsize 10 maximum 127 step 1 - code0 {o->init("Pveloffs");} + code0 {o->init("Pveloffs"); o->reset_value=64;} class Fl_Osc_Dial } Fl_Dial {} { label {Vel.Sns.} tooltip {Velocity Sensing Function} xywh {95 40 25 25} box ROUND_UP_BOX labelsize 10 maximum 127 step 1 - code0 {o->init("Pvelsns");} + code0 {o->init("Pvelsns"); o->reset_value=64;} class Fl_Osc_Dial } Fl_Button {} { @@ -453,31 +453,31 @@ if (event==FL_RIGHT_MOUSE){ Fl_Dial {} { label PanDpth tooltip {Panning Depth} xywh {10 55 30 30} labelsize 10 maximum 127 step 1 - code0 {o->init("panning.depth");} + code0 {o->init("panning.depth");o->reset_value=64;} class Fl_Osc_Dial } Fl_Dial {} { label FltCut tooltip {Filter Cutoff depth} xywh {90 55 30 30} labelsize 10 maximum 127 step 1 - code0 {o->init("filtercutoff.depth");} + code0 {o->init("filtercutoff.depth");o->reset_value=64;} class Fl_Osc_Dial } Fl_Dial {} { label FltQ tooltip {Filter Q depth} xywh {50 55 30 30} labelsize 10 maximum 127 step 1 - code0 {o->init("filterq.depth");} + code0 {o->init("filterq.depth");o->reset_value=64;} class Fl_Osc_Dial } Fl_Dial {} { label BwDpth tooltip {BandWidth depth} xywh {125 10 30 30} labelsize 10 maximum 127 step 1 - code0 {o->init("bandwidth.depth");} + code0 {o->init("bandwidth.depth");o->reset_value=64;} class Fl_Osc_Dial } Fl_Dial {} { label ModWh tooltip {Modulation Wheel depth} xywh {50 10 30 30} labelsize 10 maximum 127 step 1 - code0 {o->init("modwheel.depth");} + code0 {o->init("modwheel.depth");o->reset_value=80;} class Fl_Osc_Dial } Fl_Check_Button benddir { @@ -551,7 +551,7 @@ else {bendrng->oscMove("pitchwheel.bendrange");}} Fl_Dial {} { label time tooltip {Portamento time} xywh {285 60 25 25} labelsize 10 maximum 127 step 1 - code0 {o->init("portamento.time");} + code0 {o->init("portamento.time");o->reset_value=64;} class Fl_Osc_Dial } Fl_Counter {} { @@ -573,19 +573,19 @@ else {bendrng->oscMove("pitchwheel.bendrange");}} Fl_Dial {} { label {t.dn/up} tooltip {Portamento time stretch (up/down)} xywh {315 60 25 25} labelsize 10 maximum 127 step 1 - code0 {o->init("portamento.updowntimestretch");} + code0 {o->init("portamento.updowntimestretch");o->reset_value=64;} class Fl_Osc_Dial } Fl_Dial propta { label {Prp.Rate} tooltip {Distance required to double change from nonpropotinal portamento time} xywh {405 20 25 25} labelsize 9 maximum 127 step 1 - code0 {o->init("portamento.propRate");} + code0 {o->init("portamento.propRate");o->reset_value=80;} class Fl_Osc_Dial } Fl_Dial proptb { label {Prp.Dpth} tooltip {The difference from nonproportinal portamento} xywh {405 60 25 25} labelsize 9 maximum 127 step 1 - code0 {o->init("portamento.propDepth");} + code0 {o->init("portamento.propDepth");o->reset_value=90;} class Fl_Osc_Dial } Fl_Check_Button {} { @@ -605,13 +605,13 @@ else {propta->deactivate();proptb->deactivate();}} Fl_Dial {} { label BWdpth tooltip {BandWidth controller depth} xywh {455 60 25 25} labelsize 10 maximum 127 step 1 - code0 {o->init("resonancebandwidth.depth");} + code0 {o->init("resonancebandwidth.depth");o->reset_value=64;} class Fl_Osc_Dial } Fl_Dial {} { label CFdpth tooltip {Center Frequency controller Depth} xywh {455 20 25 25} labelsize 10 maximum 127 step 1 - code0 {o->init("resonancecenter.depth");} + code0 {o->init("resonancecenter.depth");o->reset_value=64;} class Fl_Osc_Dial } } diff --git a/src/UI/ResonanceUI.fl b/src/UI/ResonanceUI.fl @@ -169,14 +169,14 @@ redrawPADnoteApply();} callback {centerfreqvo->do_callback(); redrawPADnoteApply();} xywh {260 268 90 14} box FLAT_BOX type {Horz Knob} labelsize 10 maximum 127 step 1 - code0 {o->init("Pcenterfreq", 'i');} + code0 {o->init("Pcenterfreq", 'i');o->reset_value=64;} class Fl_Osc_Slider } Fl_Slider octavesfreq { callback {octavesfreqvo->do_callback(); redrawPADnoteApply();} xywh {260 286 90 14} box FLAT_BOX type {Horz Knob} labelsize 10 maximum 127 step 1 - code0 {o->init("Poctavesfreq", 'i');} + code0 {o->init("Poctavesfreq", 'i');o->reset_value=64;} class Fl_Osc_Slider } Fl_Button {} { diff --git a/src/UI/SUBnoteUI.fl b/src/UI/SUBnoteUI.fl @@ -164,19 +164,19 @@ class SUBnoteUI {open : {public PresetsUI_} Fl_Value_Slider vol { label Vol tooltip Volume xywh {10 25 140 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1 - code0 {o->init("PVolume");} + code0 {o->init("PVolume");o->reset_value=96;} class Fl_Osc_VSlider } Fl_Value_Slider vsns { label {V.Sns} tooltip {Velocity Sensing Function (rightmost to disable)} xywh {10 45 140 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1 - code0 {o->init("PAmpVelocityScaleFunction");} + code0 {o->init("PAmpVelocityScaleFunction");o->reset_value=90;} class Fl_Osc_VSlider } Fl_Dial pan { label Pan tooltip {Panning (leftmost is Random)} xywh {185 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1 - code0 {o->init("PPanning");} + code0 {o->init("PPanning");o->reset_value=64;} class Fl_Osc_Dial } Fl_Group ampenv { @@ -289,8 +289,8 @@ freqsettingsui->redraw();} } Fl_Dial bendadjdial { label {Bend Adj.} - tooltip {How the frequency varies according to the pitch wheel} xywh {448 53 15 15} box ROUND_UP_BOX labelsize 10 align 8 maximum 127 step 1 - code0 {o->init("PBendAdjust");} + tooltip {How the frequency varies according to the pitch wheel} xywh {448 53 15 15} box ROUND_UP_BOX labelsize 10 align 8 minimum -64 maximum 63 step 1 + code0 {o->init("PBendAdjust"); o->reset_value=24;o->set_transform(1.0/24, 0);o->set_rounding(2);} class Fl_Osc_Dial } Fl_Check_Button hz440 { @@ -358,7 +358,7 @@ bandwidthsettingsui->redraw();} Fl_Value_Slider bandwidth { label {Band Width} xywh {225 40 115 15} type {Horz Knob} box NO_BOX labelsize 10 align 1 maximum 127 step 1 - code0 {o->init("Pbandwidth");} + code0 {o->init("Pbandwidth");o->reset_value=40;} class Fl_Osc_VSlider } Fl_Value_Slider bwidthscale { diff --git a/src/UI/TipWin.cpp b/src/UI/TipWin.cpp @@ -11,7 +11,7 @@ TipWin::TipWin(void):Fl_Menu_Window(1, 1) end(); } -void TipWin::setRounding(unsigned int digits) +void TipWin::set_rounding(unsigned int digits) { format[3] = "0123456789"[digits < 9 ? digits : 9]; } diff --git a/src/UI/TipWin.h b/src/UI/TipWin.h @@ -13,7 +13,7 @@ class TipWin:public Fl_Menu_Window void showValue(float f); void setText(const char *c); void showText(); - void setRounding(unsigned int digits = 0); + void set_rounding(unsigned int digits = 0); private: void redraw(); const char *getStr() const; diff --git a/src/UI/WidgetPDial.cpp b/src/UI/WidgetPDial.cpp @@ -12,8 +12,8 @@ WidgetPDial::WidgetPDial(int x, int y, int w, int h, const char *label) :Fl_Dial(x, y, w, h, label), reset_value(0), integer_step(true), - oldvalue(0.0f), pos(false), textset(false), value_offset(0.0), - value_scale(1.0) + use_rounding(false), oldvalue(0.0f), pos(false), textset(false), + value_offset(0.0), value_scale(1.0) { //cout << "[" << label << "] There are now " << ++numobj << endl; Fl_Group *save = Fl_Group::current(); @@ -28,9 +28,9 @@ WidgetPDial::~WidgetPDial() delete tipwin; } -void WidgetPDial::setRounding(unsigned int digits) +void WidgetPDial::set_rounding(unsigned int digits) { - tipwin->setRounding(digits); + tipwin->set_rounding(digits); } #define MOD_MASK (FL_CTRL | FL_SHIFT) @@ -55,15 +55,17 @@ int WidgetPDial::handle(int event) switch(event) { case FL_PUSH: mod_state = Fl::event_state() & MOD_MASK; - if (integer_step) - setRounding(0); - else if (mod_state == MOD_MASK) - setRounding(5); - else if (mod_state == FL_SHIFT) - setRounding(4); - else - setRounding((Fl::event_button3() || mod_state & FL_CTRL) - ? 3 : 2); + if (!use_rounding) { + if (integer_step) + set_rounding(0); + else if (mod_state == MOD_MASK) + set_rounding(5); + else if (mod_state == FL_SHIFT) + set_rounding(4); + else + set_rounding((Fl::event_button3() || mod_state & FL_CTRL) + ? 3 : 2); + } oldvalue = value(); old_y = Fl::event_y(); case FL_DRAG: @@ -73,15 +75,18 @@ int WidgetPDial::handle(int event) if (old_mod_state != mod_state) { oldvalue = value(); old_y = Fl::event_y(); - if (integer_step) - setRounding(0); - else if (mod_state == MOD_MASK) - setRounding(5); - else if (mod_state == FL_SHIFT) - setRounding(4); - else - setRounding((Fl::event_button3() || mod_state & FL_CTRL) - ? 3 : 2); + if (!use_rounding) { + if (integer_step) + set_rounding(0); + else if (mod_state == MOD_MASK) + set_rounding(5); + else if (mod_state == FL_SHIFT) + set_rounding(4); + else + set_rounding((Fl::event_button3() || + mod_state & FL_CTRL) + ? 3 : 2); + } break; } dy = old_y - Fl::event_y(); @@ -109,7 +114,7 @@ int WidgetPDial::handle(int event) dy = - Fl::event_dy(); if (integer_step) { - setRounding(0); + if (!use_rounding) set_rounding(0); result = (int)(value() + dy * ((Fl::event_ctrl() || Fl::event_shift()) ? 1 : 8)); @@ -117,16 +122,16 @@ int WidgetPDial::handle(int event) float dragsize; if (mod_state == MOD_MASK) { dragsize = 100000.0; - setRounding(5); + if (!use_rounding) set_rounding(5); } else if (mod_state == FL_SHIFT) { dragsize = 10000.0; - setRounding(4); + if (!use_rounding) set_rounding(4); } else if (mod_state == FL_CTRL) { dragsize = 1000.0; - setRounding(3); + if (!use_rounding) set_rounding(3); } else { dragsize = 100.0; - setRounding(2); + if (!use_rounding) set_rounding(2); } result = value() + dy / dragsize * (max - min); } @@ -254,6 +259,7 @@ void WidgetPDial::set_transform(float scale, float offset) { value_offset = offset; value_scale = scale; + use_rounding = true; } float WidgetPDial::transform(float x) diff --git a/src/UI/WidgetPDial.h b/src/UI/WidgetPDial.h @@ -17,10 +17,11 @@ class WidgetPDial:public Fl_Dial void tooltip(const char *c); void set_transform(float scale = 1.0, float offset = 0.0); float transform(float x); - void setRounding(unsigned int digits = 0); + void set_rounding(unsigned int digits = 0); float reset_value; protected: bool integer_step; + bool use_rounding; private: void getPos(); void resetPos();