Skip to content

Commit c820643

Browse files
committed
fixes #154, hacky temp fix for timing issue
1 parent eec0896 commit c820643

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

crates/notation_core/src/duration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl Units {
8585
pub const _MIN_ACCURACY: f32 = 0.00001;
8686
pub const MIN_ACCURACY: Units = Units(Self::_MIN_ACCURACY);
8787
/*
88-
* This i quite messy here, the pasition passed checking needs some cleanup,
88+
* This is quite messy here, the pasition passed checking needs some cleanup,
8989
* mainly for control the guitar view timing, and seeking next note
9090
*/
9191
pub const HALF_MIN_ACCURACY: Units = Units(Self::_MIN_ACCURACY * 0.5);

crates/notation_midi/src/midi_message.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pub struct MidiMessage {
1010
pub midi: StructuredShortMessage,
1111
}
1212
impl MidiMessage {
13+
pub const DELAY_GAP: Units = Units(Units::_MIN_ACCURACY * 2.0);
1314
pub fn new(
1415
pass_mode: EntryPassMode,
1516
pos: BarPosition,
@@ -39,7 +40,7 @@ impl MidiMessage {
3940
}
4041
pub fn effect_position(&self) -> BarPosition {
4142
if self.delay {
42-
self.pos.with_delay(self.duration)
43+
self.pos.with_delay(self.duration - Self::DELAY_GAP)
4344
} else {
4445
self.pos
4546
}

0 commit comments

Comments
 (0)