diff --git a/README.md b/README.md index c4c77f7..7f4a559 100644 --- a/README.md +++ b/README.md @@ -62,16 +62,16 @@ Use [configs/MacroButtons-Midi-keybow.xml](configs/MacroButtons-Midi-keybow.xml) ### Key mapping: - ┌─┬────────────┬─┬────────────┬──┬────────────────┬──┬──────────────┐ - │3│Google Meet │7│Previous │11│Next │15│Play/Pause │ - │ │Mute Toggle │ │ │ │ │ │ │ - ├─┼────────────┼─┼────────────┼──┼────────────────┼──┼──────────────┤ - │2│Teams │6│MIDI Cable │10│MIDI Headphones │14│Speakers │ - │ │Mute Toggle │ │Volume Up │ │Volume Up │ │Volume Up │ - ├─┼────────────┼─┼────────────┼──┼────────────────┼──┼──────────────┤ - │1│ │5│MIDI Cable │ 9│MIDI Headphones │13│Speakers │ - │ | │ │Volume Down │ │Volume Down │ │Volume Down │ - ├─┼────────────┼─┼────────────┼──┼────────────────┼──┼──────────────┤ - │0│MIDI Mic │4│MIDI Cable │ 8│MIDI Headphones │12│Speakers │ - │ │Mute Toggle │ │Mute Toggle │ │Mute Toggle │ │Mute Toggle │ - └─┴────────────┴─┴────────────┴──┴────────────────┴──┴──────────────┘ + ┌─┬────────────┬─┬───────────┬──┬────────────────┬──┬──────────────┐ + │3│Google Meet │7│Previous │11│Next │15│Play/Pause │ + │ │Mute │ │ │ │ │ │ │ + ├─┼────────────┼─┼───────────┼──┼────────────────┼──┼──────────────┤ + │2│Teams │6│MIDI Cable │10│MIDI Headphones │14│Speakers │ + │ │Mute │ │Volume Up │ │Volume Up │ │Volume Up │ + ├─┼────────────┼─┼───────────┼──┼────────────────┼──┼──────────────┤ + │1│Reset Voice │5│MIDI Cable │ 9│MIDI Headphones │13│Speakers │ + │ |Meeter conf │ │Volume Down│ │Volume Down │ │Volume Down │ + ├─┼────────────┼─┼───────────┼──┼────────────────┼──┼──────────────┤ + │0│MIDI Mic │4│MIDI Cable │ 8│MIDI Headphones │12│Speakers │ + │ │Mute │ │Mute │ │Mute │ │Mute │ + └─┴────────────┴─┴───────────┴──┴────────────────┴──┴──────────────┘ diff --git a/code.py b/code.py index 00b151c..9e726e9 100644 --- a/code.py +++ b/code.py @@ -47,8 +47,8 @@ │2│Teams │6│MIDI Cable │10│MIDI Headphones │14│Speakers │ │ │Mute │ │Volume Up │ │Volume Up │ │Volume Up │ ├─┼────────────┼─┼───────────┼──┼────────────────┼──┼──────────────┤ -│1│ │5│MIDI Cable │ 9│MIDI Headphones │13│Speakers │ -│ | │ │Volume Down│ │Volume Down │ │Volume Down │ +│1│Reset Voice │5│MIDI Cable │ 9│MIDI Headphones │13│Speakers │ +│ |Meeter conf │ │Volume Down│ │Volume Down │ │Volume Down │ ├─┼────────────┼─┼───────────┼──┼────────────────┼──┼──────────────┤ │0│MIDI Mic │4│MIDI Cable │ 8│MIDI Headphones │12│Speakers │ │ │Mute │ │Mute │ │Mute │ │Mute │ @@ -56,7 +56,8 @@ """) # Keys categories -blank = [1] +blank = [] +reset = [1] mic = [0] teams = [2] meet = [3] @@ -67,9 +68,10 @@ control = [7,11] playpause = [15] + # Sleep mode for keys keybow.led_sleep_enabled = True -keybow.led_sleep_time = 600 +keybow.led_sleep_time = 900 # Colors black = (0,0,0) @@ -85,15 +87,18 @@ green = (0,255,0) weak_purple = (42,0,42) purple = (128,0,128) +weak_yellow = (128,128,0) +yellow = (255,255,0) + + + +#mic_muted = True +#cable_muted = False +#speakers_muted = False +#headphones_muted = True -# mute led status when starting (need to config things accordingly...) -mic_muted = True -cable_muted = False -speakers_muted = False -headphones_muted = True -# bolean to get the mic key blinking when mic is unmuted -mic_blink = False +#mic_blink = False # Function for send Midi keypress def midi_send(key): @@ -103,6 +108,22 @@ def midi_send(key): midi.send(NoteOn(note, velocity)) midi.send(NoteOff(note, 0)) +def reset_config(): + # mute led status when starting (need to config things accordingly...) + global mic_muted + global cable_muted + global speakers_muted + global headphones_muted + # bolean to get the mic key blinking when mic is unmuted + global mic_blink + # Values at boot time + mic_muted = True + cable_muted = False + speakers_muted = False + headphones_muted = True + mic_blink = False + # Reset Voice Meeter config + midi_send(1) # Small animation when starting keybow.set_all(*black) @@ -112,6 +133,8 @@ def midi_send(key): for key in keys: key.set_led(*white) +reset_config() + while True: keybow.update() @@ -135,6 +158,9 @@ def midi_send(key): for i in playpause: keybow.keys[i].set_led(*weak_green) + for i in reset: + keybow.keys[i].set_led(*weak_yellow) + for i in mic: if mic_muted: keybow.keys[i].set_led(*weak_red) @@ -171,8 +197,13 @@ def midi_send(key): time.sleep(0.2) mic_muted = not mic_muted - elif keys[1].pressed: - pass + elif keys[1].held: + print('Reset Voice Meeter Banana Config key pressed') + keybow.keys[1].set_led(*yellow) + midi_send(1) + reset_config() + time.sleep(0.5) + keyboard.release_all() elif keys[2].pressed: print('Teams Mute key pressed') @@ -264,4 +295,4 @@ def midi_send(key): keybow.keys[15].set_led(*green) consumer.send(ConsumerControlCode.PLAY_PAUSE) keyboard.release_all() - time.sleep(0.1) \ No newline at end of file + time.sleep(0.1) diff --git a/configs/MacroButtons-Midi-keybow.xml b/configs/MacroButtons-Midi-keybow.xml index d5a9958..051166e 100644 --- a/configs/MacroButtons-Midi-keybow.xml +++ b/configs/MacroButtons-Midi-keybow.xml @@ -1,6 +1,6 @@ - + @@ -21,6 +21,35 @@ Bus(1).gain+=4.0; + + + + + reset config + + + Strip(0).Mute=1; +Strip(0).Gain=0; +Strip(1).Mute=1; +Strip(1).Gain=-60; +Strip(2).Mute=0; +Strip(2).Gain=-20; +Strip(3).Mute=0; +Strip(3).Gain=0; +Strip(4).Mute=0; +Strip(4).Gain=0; +Bus[0].Mute=0; +Bus[0].Gain=-8; +Bus[1].Mute=1; +Bus[1].Gain=0; +Bus[2].Mute=1; +Bus[2].Gain=0; +Bus[3].Mute=0; +Bus[3].Gain=0; +Bus[4].Mute=1; +Bus[4].Gain=0; + +