Cut short the starting delay of midis if too long
This commit is contained in:
parent
707b5e6f0c
commit
3d2f89e10f
1 changed files with 11 additions and 0 deletions
|
@ -126,6 +126,17 @@ public class MidiConverter {
|
||||||
}
|
}
|
||||||
|
|
||||||
song.sort();
|
song.sort();
|
||||||
|
|
||||||
|
// Shift to beginning if delay is too long
|
||||||
|
if (!song.notes.isEmpty()) {
|
||||||
|
long shift = song.notes.get(0).time - 1000;
|
||||||
|
if (song.notes.get(0).time > 1000) {
|
||||||
|
for (Note note : song.notes) {
|
||||||
|
note.time -= shift;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
song.length -= shift;
|
||||||
|
}
|
||||||
|
|
||||||
return song;
|
return song;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue