1
0
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:
Pokechu22
2018-01-14 12:08:20 -08:00
committed by James Crook
parent 8e8d838a08
commit 53823270e0
6 changed files with 130 additions and 88 deletions

View File

@@ -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;
}