Skip to content

Commit

Permalink
Show Panning in {(random,) % left, centered, %% right}
Browse files Browse the repository at this point in the history
Show Volume in dB
Show LFO Delay in s
Show Amp-Envelope Sustain in %
  • Loading branch information
heuchi committed Nov 28, 2016
1 parent bf7b525 commit d709748
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/UI/ADnoteUI.fl
Expand Up @@ -94,7 +94,7 @@ collect_data(synth, o->value(), (Fl::event_button() | 0xc0), 1, npart, kititem,
}
Fl_Dial voicepanning {
callback {pars->setVoicePan(nvoice, lrint(o->value()));

o->show_panning_value();
collect_data(synth, o->value(), (Fl::event_button() | 0xc0), 2, npart, kititem, 0x80 + nvoice);}
tooltip {Voice panning - zero/leftmost is Random} xywh {215 5 20 20} box ROUND_UP_BOX labelsize 10 align 4 maximum 127 step 1
code0 {o->value(pars->VoicePar[nvoice].PPanning);}
Expand Down Expand Up @@ -880,6 +880,7 @@ send_data(49, o->value(), 0xc8);}
Fl_Dial voicevolume {
label Volume
callback {pars->VoicePar[nvoice].PVolume = lrint(o->value());
o->show_custom_value_units(-60.0f*(1.0f-lrint(o->value())/127.0f),"dB",1);
send_data(0, o->value(), 0xc8);}
tooltip Volume xywh {42 56 34 34} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
code0 {o->value(pars->VoicePar[nvoice].PVolume);}
Expand Down Expand Up @@ -907,6 +908,7 @@ send_data(1, o->value(), 0xc8);}
callback {//
pars->setVoicePan(nvoice, lrint(o->value()));
voicerandompan->value(pars->randomVoicePan(nvoice));
o->show_panning_value();
send_data(2, o->value(), 0xc8);}
tooltip {Voice panning - leftmost/zero gives random panning} xywh {174 56 34 34} box ROUND_UP_BOX labelsize 10 align 6 maximum 127 step 1
code0 {o->value(pars->VoicePar[nvoice].PPanning);}
Expand Down Expand Up @@ -1615,6 +1617,7 @@ class ADnoteUI {: {public PresetsUI_, SynthHelper}
Fl_Dial globalvolume {
label Volume
callback {pars->GlobalPar.PVolume = lrint(o->value());
o->show_custom_value_units(-60.0f*(1.0f-lrint(o->value())/96.0f),"dB",1);
send_data(0, o->value(), 0xc8);}
tooltip Volume xywh {39 22 35 35} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
code0 {o->value(pars->GlobalPar.PVolume);}
Expand All @@ -1636,6 +1639,7 @@ send_data(1, o->value(), 0xc8);}
pars->setGlobalPan(lrint(o->value()));
globalrandompan->value(pars->randomGlobalPan());
amplitudegrp->changed();
o->show_panning_value();
send_data(2, o->value(), 0xc8);}
tooltip {Global panning - leftmost/zero gives random panning} xywh {173 22 35 35} box ROUND_UP_BOX labelsize 10 align 6 maximum 127 step 1
code0 {o->value(pars->GlobalPar.PPanning);}
Expand Down
1 change: 1 addition & 0 deletions src/UI/EnvelopeUI.fl
Expand Up @@ -467,6 +467,7 @@ send_data(group, 5, o->value(), 0xc8);}
label {S.val}
callback {env->PS_val=(int)o->value();
freeedit->redraw();
o->show_percent_value();
send_data(group, 4, o->value(), 0xc8);}
tooltip {Sustain value} xywh {75 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
code0 {o->value(env->PS_val);}
Expand Down
2 changes: 2 additions & 0 deletions src/UI/LFOUI.fl
Expand Up @@ -109,6 +109,8 @@ send_data(group, 1, o->value(), 0xc8);}
Fl_Dial delay {
label Delay
callback {pars->Pdelay=(int)o->value();
float delayTime = ((int)o->value()) / 127.0f * 4.0f + 0.005f;
o->show_custom_value_units(delayTime,"s",2);
send_data(group, 2, o->value(), 0xc8);}
tooltip {LFO delay} xywh {110 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
code0 {if (engine >= 0x80 && group == 0) o->init(30); else o->init(0);}
Expand Down
2 changes: 2 additions & 0 deletions src/UI/MasterUI.fl
Expand Up @@ -597,6 +597,8 @@ paramsui->Show(4);}
Fl_Dial mastervolumedial {
label Volume
callback {synth->setPvolume(o->value());
float dBval = (o->value()-96.0f)/96.0f*40.0f;
o->show_custom_value_units(dBval, "dB", 1);
send_data(0, o->value(), 0x48);}
tooltip {Master Volume} xywh {331 31 40 40} box ROUND_UP_BOX color 29 labelsize 10 maximum 127 step 1
code0 {o->value(synth->Pvolume);}
Expand Down
2 changes: 2 additions & 0 deletions src/UI/PADnoteUI.fl
Expand Up @@ -976,6 +976,7 @@ send_data(39, o->value(), 0xc8);}
Fl_Dial volume {
label Volume
callback {pars->PVolume=(int)o->value();
o->show_custom_value_units(-60.0f*(1.0f-(int)o->value()/96.0f),"dB",1);
send_data(0, o->value(), 0xc8);}
tooltip Volume xywh {24 42 34 34} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
code0 {o->value(pars->PVolume);}
Expand All @@ -996,6 +997,7 @@ send_data(1, o->value(), 0xc8);}
callback {//
pars->setPan((char)o->value());
randompan->value(pars->randomPan());
o->show_panning_value();
send_data(2, o->value(), 0xc8);}
tooltip {Panning - leftmost/zero is Random} xywh {175 42 34 34} box ROUND_UP_BOX labelsize 10 align 6 maximum 127 step 1
code0 {o->value(pars->PPanning);}
Expand Down
2 changes: 2 additions & 0 deletions src/UI/PartUI.fl
Expand Up @@ -462,6 +462,7 @@ send_data(4, o->value(), 0xc8);}
label Pan
callback {//
part->SetController(C_panning, o->value());
o->show_panning_value(false);
if (npart >= *plgroup && npart < (*plgroup + NUM_MIDI_CHANNELS))
synth->getGuiMaster()->setPanelPartPanWidget(npart % NUM_MIDI_CHANNELS, o->value());
send_data(2, o->value(), 0xc8);}
Expand All @@ -474,6 +475,7 @@ send_data(4, o->value(), 0xc8);}
label Volume
callback {//
part->setVolume(o->value());
o->show_custom_value_units((o->value()-96.0f)/96.0f*40.0f,"dB",1);
if (npart >= *plgroup && npart < (*plgroup + NUM_MIDI_CHANNELS))
synth->getGuiMaster()->setPanelPartVolWidget(npart % NUM_MIDI_CHANNELS, (127 - o->value()));
send_data(0, o->value(), 0xc8);}
Expand Down
2 changes: 2 additions & 0 deletions src/UI/SUBnoteUI.fl
Expand Up @@ -204,6 +204,7 @@ if ((Fl::event_button() == 3))
Fl_Dial vol {
label Volume
callback {pars->PVolume = (int)o->value();
o->show_custom_value_units(-60.0f*(1.0f-(int)o->value()/96.0f),"dB",1);
send_data (0, o->value(), 0xc8);}
tooltip Volume xywh {40 20 29 29} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
code0 {o->value(pars->PVolume);}
Expand All @@ -224,6 +225,7 @@ send_data (1, o->value(), 0xc8);}
callback {//
pars->setPan((char)o->value());
randompan->value(pars->randomPan());
o->show_panning_value();
send_data (2, o->value(), 0xc8);}
tooltip {Panning - zero/leftmost is Random} xywh {160 20 29 29} box ROUND_UP_BOX labelsize 10 align 6 maximum 127 step 1
code0 {o->value(pars->PPanning);}
Expand Down
22 changes: 22 additions & 0 deletions src/UI/WidgetPDialUI.fl
Expand Up @@ -336,6 +336,11 @@ class WidgetPDial {selected : {public Fl_Dial}
code {tipwin->setText(c);
textset = true;} {}
}
Function {show_custom_value(string v)} {return_type void
} {
code {tipwin->customValue(v);
showplainvalue = false;} {}
}
Function {show_custom_value_units(float v, string u, int prec=0)} {return_type void
} {
code {ostringstream oss;
Expand All @@ -345,6 +350,23 @@ class WidgetPDial {selected : {public Fl_Dial}
tipwin->customValue(string(oss.str()));
showplainvalue = false;} {}
}
Function {show_percent_value()} {} {
code {
float pc = (value() - minimum()) / (maximum() - minimum()) * 100.0f;
show_custom_value_units(pc, "%", 1);
}
Function {show_panning_value(bool hasRandom=true)} {} {
code {int val = lrint(value());
if(hasRandom && val==0)
show_custom_value("random");
else if(val==64)
show_custom_value("centered");
else if(val<64)
show_custom_value_units((64.0f - val)
/ (hasRandom ? 63.0f : 64.0f)*100.0f,"% left");
else
show_custom_value_units((val - 64.0f)/63.0f*100.0f,"% right");
}
decl {bool textset;} {private local
}
decl {bool pos;} {private local
Expand Down

0 comments on commit d709748

Please sign in to comment.