From 38e84b7ded0c31d4f892ae1f83e6fb090c0c3b71 Mon Sep 17 00:00:00 2001 From: Michael Stewart Date: Fri, 1 Nov 2024 22:44:14 -0400 Subject: [PATCH] fixes #45 --- lib/flat.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/flat.js b/lib/flat.js index 250db38..13b1041 100644 --- a/lib/flat.js +++ b/lib/flat.js @@ -75,6 +75,24 @@ const pitchesToRests = (pieceScoreJSON) => { }, }), ); + + // last step of theoretical for Bb Melody Freedom 20240 Band wouldn't load. + // looks like comparing Concert Pitch TC to Bb for this part, + // the Bb version has 2 harmonies notated in a single measure, + // but the Concert Pitch TC never has 2 harmonies + // current hypothesis: in the steps above we potentially change + // the duration of the measures. this could be the issue: only in measures + // that have multiple harmonies, the second harmony would have + // its timePos > 0 but we don't currently re-compute it, + // so it ends up out of bounds in some cases + if (measure?.harmony?.length > 1) { + const harmonyDuration = currentTimeSig.duration; + measure.harmony.forEach((harmony, j) => { + measuresRef[i].harmony[j]['$adagio-location'] = { + timePos: j * harmonyDuration, + }; + }); + } }); return composeScoreJSON; };