From 63472c9c2682fb2da8bde3fc35434be2d70c3d1d Mon Sep 17 00:00:00 2001 From: Oleg Samarin Date: Sat, 22 May 2021 19:56:14 +0300 Subject: [PATCH] Increased the limit of PitchTuning and PitchCorrection up from 1200 to 1800 cents https://github.com/oleg68/GrandOrgue/issues/33 --- CHANGELOG.md | 1 + src/grandorgue/GOrguePipeConfig.cpp | 14 +++++++------- src/grandorgue/GOrgueRank.cpp | 2 +- src/grandorgue/GOrgueSoundingPipe.cpp | 6 +++--- src/grandorgue/OrganDialog.cpp | 4 ++-- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cc30f7e..694d51a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/src/grandorgue/GOrguePipeConfig.cpp b/src/grandorgue/GOrguePipeConfig.cpp index 300f1e59..fd980591 100644 --- a/src/grandorgue/GOrguePipeConfig.cpp +++ b/src/grandorgue/GOrguePipeConfig.cpp @@ -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); @@ -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); @@ -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(); diff --git a/src/grandorgue/GOrgueRank.cpp b/src/grandorgue/GOrgueRank.cpp index 1ac87575..010f2c27 100644 --- a/src/grandorgue/GOrgueRank.cpp +++ b/src/grandorgue/GOrgueRank.cpp @@ -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); diff --git a/src/grandorgue/GOrgueSoundingPipe.cpp b/src/grandorgue/GOrgueSoundingPipe.cpp index 80af928f..16000853 100644 --- a/src/grandorgue/GOrgueSoundingPipe.cpp +++ b/src/grandorgue/GOrgueSoundingPipe.cpp @@ -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); @@ -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; } diff --git a/src/grandorgue/OrganDialog.cpp b/src/grandorgue/OrganDialog.cpp index f5bc7f75..fe35b075 100644 --- a/src/grandorgue/OrganDialog.cpp +++ b/src/grandorgue/OrganDialog.cpp @@ -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); @@ -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;