Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable absolute mode for Global pitch #1189

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/common/Parameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ bool Parameter::can_be_absolute()
switch (ctrltype)
{
case ct_oscspread:
case ct_pitch_semi7bp:
case ct_pitch_semi7bp_absolutable:
return true;
}
return false;
Expand Down Expand Up @@ -256,6 +256,7 @@ void Parameter::set_type(int ctrltype)
val_default.i = 2;
break;
case ct_pitch_semi7bp:
case ct_pitch_semi7bp_absolutable:
valtype = vt_float;
val_min.f = -7;
val_max.f = 7;
Expand Down Expand Up @@ -746,6 +747,7 @@ float Parameter::get_extended(float f)
case ct_freq_shift:
return 100.f * f;
case ct_pitch_semi7bp:
case ct_pitch_semi7bp_absolutable:
return 12.f * f;
default:
return f;
Expand Down Expand Up @@ -953,6 +955,9 @@ void Parameter::get_display(char* txt, bool external, float ef)
sprintf(txt, "%.2f semitones", f);
break;
case ct_pitch_semi7bp:
sprintf(txt, "%.2f", get_extended(f));
break;
case ct_pitch_semi7bp_absolutable:
if(absolute)
sprintf(txt, "%.1f Hz", 10 * get_extended(f));
else
Expand Down
1 change: 1 addition & 0 deletions src/common/Parameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ enum ctrltypes
ct_percent_bidirectional,
ct_pitch_octave,
ct_pitch_semi7bp,
ct_pitch_semi7bp_absolutable,
ct_pitch,
ct_fmratio,
ct_fmratio_int,
Expand Down
2 changes: 1 addition & 1 deletion src/common/SurgePatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ SurgePatch::SurgePatch(SurgeStorage* storage)
cg_OSC, osc, false, Surge::ParamConfig::kHorizontal | kNoPopup));
py = gui_mainsec_slider_y;
a->push_back(scene[sc].osc[osc].pitch.assign(p_id++, id_s++, "pitch", "Pitch",
ct_pitch_semi7bp, px, py, sc_id, cg_OSC, osc,
ct_pitch_semi7bp_absolutable, px, py, sc_id, cg_OSC, osc,
true, Surge::ParamConfig::kHorizontal | kSemitone | sceasy));
py += gui_hfader_dist;
for (int i = 0; i < n_osc_params; i++)
Expand Down