mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-13 14:13:32 +02:00
Rework note tracks to store top and bottom notes instead of pitch height
This simplifies a bunch of other work -- in particular zooming so that specific notes are visible, and keeping the same notes on screen when resizing the track. Also included is a fix to YToIPitch to make it use mPitchHeight directly -- this solves some roundoff errors, which previously caused inaccurate results on some zoom levels.
This commit is contained in:
@@ -89,6 +89,7 @@ bool ImportMIDI(const FilePath &fName, NoteTrack * dest)
|
||||
// then middle pitch class is D. Round mean_pitch to the nearest D:
|
||||
int mid_pitch = ((mean_pitch - 2 + 6) / 12) * 12 + 2;
|
||||
dest->SetBottomNote(mid_pitch - 14);
|
||||
dest->SetTopNote(mid_pitch + 13);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user