Skip to content

Commit

Permalink
limit pitch to valid values in Pitch constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
lshman committed May 5, 2024
1 parent 4182094 commit dd4549b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/base/NotationTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1667,6 +1667,8 @@ Pitch::Pitch(int heightOnStaff, const Clef &clef, const Key &key,
{
displayPitchToRawPitch
(heightOnStaff, explicitAccidental, clef, key, m_pitch);
if (m_pitch < 0) m_pitch = 0;
if (m_pitch > 127) m_pitch = 127;
}

Pitch::Pitch(const Pitch &p) :
Expand Down

0 comments on commit dd4549b

Please sign in to comment.