From 9fccfc8dd5a21923ada3b2539a9eb30f8a4d1d9c Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 15 May 2018 11:36:19 -0400 Subject: [PATCH] conditional autio --- keyboards/planck/keymaps/default/keymap.c | 24 +++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/keyboards/planck/keymaps/default/keymap.c b/keyboards/planck/keymaps/default/keymap.c index dc431983e..545ca4229 100644 --- a/keyboards/planck/keymaps/default/keymap.c +++ b/keyboards/planck/keymaps/default/keymap.c @@ -305,23 +305,27 @@ void dip_update(uint8_t index, bool active) { muse_mode = true; } else { muse_mode = false; - stop_all_notes(); + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif } } } void matrix_scan_user(void) { - if (muse_mode) { - if (muse_counter == 0) { - uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; - if (muse_note != last_muse_note) { - stop_note(compute_freq_for_midi_note(last_muse_note)); - play_note(compute_freq_for_midi_note(muse_note), 0xF); - last_muse_note = muse_note; + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } } + muse_counter = (muse_counter + 1) % muse_tempo; } - muse_counter = (muse_counter + 1) % muse_tempo; - } + #endif } bool music_mask_user(uint16_t keycode) {