Просмотр исходного кода

fix first notes not playing in some samples like Clementi Sonatina 36/1/1

sschmidTU 3 лет назад
Родитель
Сommit
44d7528959
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/MusicalScore/Playback/VoicePlaybackData.ts

+ 1 - 1
src/MusicalScore/Playback/VoicePlaybackData.ts

@@ -97,7 +97,7 @@ export class VoicePlaybackData {
             maxEntryTimestamp.Add(entry.playbackEntry.Notes[0].Length);
             if (entry.enrolledTimestamp.lt(enrolledTimestamp)) {
                 if (!this.rules.PlayAlreadyStartedNotesFromCursorPosition) {
-                    if (entry.enrolledTimestamp.RealValue / enrolledTimestamp.RealValue < 0.99) {
+                    if (Math.abs(entry.enrolledTimestamp.RealValue - enrolledTimestamp.RealValue) > 0.01) {
                         continue; // don't play notes that started before current cursor position
                         // note that we'd ideally check entry < enrolled, but enrolled is imprecise,
                         //   so e.g. if you start at a timestamp 5.5, enrolled will be ~5.5019