Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Commit

Permalink
Increased the limit of PitchTuning and PitchCorrection up from 1200 t…
Browse files Browse the repository at this point in the history
…o 1800 cents #33
  • Loading branch information
Oleg Samarin committed May 22, 2021
1 parent 4c8b374 commit 63472c9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Increased the limit of PitchTuning and PitchCorrection up from 1200 to 1800 cents https://github.com/oleg68/GrandOrgue/issues/33
# 0.3.1.2338-8.os (2021-05-18)
- Closing unnecessary jack clients https://github.com/oleg68/GrandOrgue/issues/30
# 0.3.1.2338-6.os (2021-05-10)
Expand Down
14 changes: 7 additions & 7 deletions src/grandorgue/GOrguePipeConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void GOrguePipeConfig::Init(GOrgueConfigReader& cfg, wxString group, wxString pr
m_DefaultGain = 0;
m_Gain = cfg.ReadFloat(CMBSetting, group, prefix + wxT("UserGain"), -120, 40, false, m_DefaultGain);
m_DefaultTuning = 0;
m_Tuning = cfg.ReadFloat(CMBSetting, group, prefix + wxT("Tuning"), -1200, 1200, false, m_DefaultTuning);
m_Tuning = cfg.ReadFloat(CMBSetting, group, prefix + wxT("Tuning"), -1800, 1800, false, m_DefaultTuning);
m_DefaultDelay = 0;
m_Delay = cfg.ReadInteger(CMBSetting, group, prefix + wxT("Delay"), 0, 10000, false, m_DefaultDelay);
m_BitsPerSample = cfg.ReadInteger(CMBSetting, m_Group, m_NamePrefix + wxT("BitsPerSample"), -1, 24, false, -1);
Expand All @@ -83,8 +83,8 @@ void GOrguePipeConfig::Load(GOrgueConfigReader& cfg, wxString group, wxString pr
m_Amplitude = cfg.ReadFloat(CMBSetting, group, prefix + wxT("Amplitude"), 0, 1000, false, m_DefaultAmplitude);
m_DefaultGain = cfg.ReadFloat(ODFSetting, group, prefix + wxT("Gain"), -120, 40, false, 0);
m_Gain = cfg.ReadFloat(CMBSetting, group, prefix + wxT("UserGain"), -120, 40, false, m_DefaultGain);
m_DefaultTuning = cfg.ReadFloat(ODFSetting, group, prefix + wxT("PitchTuning"), -1200, 1200, false, 0);
m_Tuning = cfg.ReadFloat(CMBSetting, group, prefix + wxT("Tuning"), -1200, 1200, false, m_DefaultTuning);
m_DefaultTuning = cfg.ReadFloat(ODFSetting, group, prefix + wxT("PitchTuning"), -1800, 1800, false, 0);
m_Tuning = cfg.ReadFloat(CMBSetting, group, prefix + wxT("Tuning"), -1800, 1800, false, m_DefaultTuning);
m_DefaultDelay = cfg.ReadInteger(ODFSetting, group, prefix + wxT("TrackerDelay"), 0, 10000, false, 0);
m_Delay = cfg.ReadInteger(CMBSetting, group, prefix + wxT("Delay"), 0, 10000, false, m_DefaultDelay);
m_BitsPerSample = cfg.ReadInteger(CMBSetting, m_Group, m_NamePrefix + wxT("BitsPerSample"), -1, 24, false, -1);
Expand Down Expand Up @@ -178,10 +178,10 @@ float GOrguePipeConfig::GetDefaultTuning()

void GOrguePipeConfig::SetTuning(float cent)
{
if (cent < -1200)
cent = -1200;
if (cent > 1200)
cent = 1200;
if (cent < -1800)
cent = -1800;
if (cent > 1800)
cent = 1800;
m_Tuning = cent;
m_OrganFile->Modified();
m_Callback->UpdateTuning();
Expand Down
2 changes: 1 addition & 1 deletion src/grandorgue/GOrgueRank.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void GOrgueRank::Load(GOrgueConfigReader& cfg, wxString group, int first_midi_no
m_WindchestGroup = cfg.ReadInteger(ODFSetting, group, wxT("WindchestGroup"), 1, m_organfile->GetWindchestGroupCount());
m_Percussive = cfg.ReadBoolean(ODFSetting, group, wxT("Percussive"));
m_HarmonicNumber = cfg.ReadInteger(ODFSetting, group, wxT("HarmonicNumber"), 1, 1024, false, 8);
m_PitchCorrection = cfg.ReadFloat(ODFSetting, group, wxT("PitchCorrection"), -1200, 1200, false, 0);
m_PitchCorrection = cfg.ReadFloat(ODFSetting, group, wxT("PitchCorrection"), -1800, 1800, false, 0);
m_MinVolume = cfg.ReadFloat(ODFSetting, group, wxT("MinVelocityVolume"), 0, 1000, false, 100);
m_MaxVolume = cfg.ReadFloat(ODFSetting, group, wxT("MaxVelocityVolume"), 0, 1000, false, 100);
m_RetuneRank = cfg.ReadBoolean(ODFSetting, group, wxT("AcceptsRetuning"), false, true);
Expand Down
6 changes: 3 additions & 3 deletions src/grandorgue/GOrgueSoundingPipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void GOrgueSoundingPipe::Load(GOrgueConfigReader& cfg, wxString group, wxString
m_Filename = cfg.ReadStringTrim(ODFSetting, group, prefix);
m_PipeConfig.Load(cfg, group, prefix);
m_HarmonicNumber = cfg.ReadInteger(ODFSetting, group, prefix + wxT("HarmonicNumber"), 1, 1024, false, m_HarmonicNumber);
m_PitchCorrection = cfg.ReadFloat(ODFSetting, group, prefix + wxT("PitchCorrection"), -1200, 1200, false, m_PitchCorrection);
m_PitchCorrection = cfg.ReadFloat(ODFSetting, group, prefix + wxT("PitchCorrection"), -1800, 1800, false, m_PitchCorrection);
m_SamplerGroupID = cfg.ReadInteger(ODFSetting, group, prefix + wxT("WindchestGroup"), 1, m_organfile->GetWindchestGroupCount(), false, m_SamplerGroupID);
m_Percussive = cfg.ReadBoolean(ODFSetting, group, prefix + wxT("Percussive"), false, m_Percussive);
m_SampleMidiKeyNumber = cfg.ReadInteger(ODFSetting, group, prefix + wxT("MIDIKeyNumber"), -1, 127, false, -1);
Expand Down Expand Up @@ -305,9 +305,9 @@ void GOrgueSoundingPipe::Validate()
offset = 0;
else
offset= m_SoundProvider.GetMidiKeyNumber() + log(8.0 / m_HarmonicNumber) * (12.0 / log(2)) - (m_SoundProvider.GetMidiPitchFract() - m_PipeConfig.GetDefaultTuning() + m_PitchCorrection) / 100.0 - m_MidiKeyNumber;
if (offset < -12 || offset > 12)
if (offset < -18 || offset > 18)
{
wxLogError(_("rank %s pipe %s: temperament would retune pipe by more than 1200 cent"),
wxLogError(_("rank %s pipe %s: temperament would retune pipe by more than 1800 cent"),
m_Rank->GetName().c_str(), GetLoadTitle().c_str());
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/grandorgue/OrganDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ OrganDialog::OrganDialog (GOrgueDocumentBase* doc, wxWindow* parent, GrandOrgueF
box2->Add(m_Tuning);
box2->Add(m_TuningSpin);
grid->Add(box2);
m_TuningSpin->SetRange(-1200, 1200);
m_TuningSpin->SetRange(-1800, 1800);

grid->Add(new wxStaticText(this, wxID_ANY, _("Tracker (ms):")), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxBOTTOM, 5);
box2 = new wxBoxSizer(wxHORIZONTAL);
Expand Down Expand Up @@ -702,7 +702,7 @@ void OrganDialog::OnEventApply(wxCommandEvent &e)

if (!m_Tuning->GetValue().ToDouble(&tuning) &&
(m_Tuning->IsModified() &&
(tuning < - 1200 || tuning > 1200)))
(tuning < - 1800 || tuning > 1800)))
{
GOMessageBox(_("Tuning is invalid"), _("Error"), wxOK | wxICON_ERROR, this);
return;
Expand Down

0 comments on commit 63472c9

Please sign in to comment.