Skip to content

Commit 26941cd

Browse files
committed
wasm pitch fix
1 parent b8ccd47 commit 26941cd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crates/notation_midi/src/midi_util.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ pub struct MidiUtil();
1212

1313
impl MidiUtil {
1414
pub fn note_midi_key_number(note: &Note) -> Option<KeyNumber> {
15+
#[cfg(not(target_arch = "wasm32"))]
1516
let midi_note = Semitones::from(*note).0 + 12 - 1; //Not sure why got a higher pitch when playing, temp fix for get it right in video
17+
#[cfg(target_arch = "wasm32")]
18+
let midi_note = Semitones::from(*note).0 + 12;
1619
KeyNumber::try_from(midi_note as u8).ok()
1720
}
1821
pub fn note_midi_on_msg(

0 commit comments

Comments
 (0)