Skip to content

Commit 2bdd330

Browse files
committed
always play guitar audio when seeking
1 parent 1082f87 commit 2bdd330

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

crates/notation_midi/src/midi_settings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl Default for MidiSettings {
3131
Self {
3232
bypass_hub: false,
3333
click_mute: false,
34-
click_velocity: 40,
34+
click_velocity: 50,
3535
click_octave: Octave::P7,
3636
vocal_mute: false,
3737
vocal_velocity: 110,

crates/notation_midi/src/midi_state.rs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,19 @@ impl MidiChannel {
108108
if !bypass {
109109
match &self.track {
110110
Some(track) => {
111-
match track.kind {
112-
TrackKind::Vocal => {
113-
velocity = if settings.vocal_mute { 0 } else { settings.vocal_velocity };
114-
},
115-
TrackKind::Guitar => {
116-
velocity = if settings.guitar_mute { 0 } else { settings.guitar_velocity };
117-
},
118-
TrackKind::Piano => {
119-
velocity = if settings.piano_mute { 0 } else { settings.piano_velocity };
120-
},
121-
_ => (),
111+
if !is_seeking || track.kind != settings.seeking_track {
112+
match track.kind {
113+
TrackKind::Vocal => {
114+
velocity = if settings.vocal_mute { 0 } else { settings.vocal_velocity };
115+
},
116+
TrackKind::Guitar => {
117+
velocity = if settings.guitar_mute { 0 } else { settings.guitar_velocity };
118+
},
119+
TrackKind::Piano => {
120+
velocity = if settings.piano_mute { 0 } else { settings.piano_velocity };
121+
},
122+
_ => (),
123+
}
122124
}
123125
},
124126
None => {
@@ -265,7 +267,7 @@ impl MidiState {
265267
let scale_root = tab.meta.scale.calc_root_syllable();
266268
let signature = tab.signature();
267269
let bar_units = tab.bar_units();
268-
let beat_delay = Some(Units::from(signature.beat_unit));
270+
let beat_delay = Some(Units::from(signature.beat_unit) - Units::MIN_ACCURACY);
269271
for bar in tab.bars.iter() {
270272
for beat in 0..signature.bar_beats {
271273
let in_bar_pos = Units(beat as f32 * Units::from(signature.beat_unit).0);

0 commit comments

Comments
 (0)