-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for sending MIDI notes as keys (#5)
- Loading branch information
Showing
8 changed files
with
84 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# MACROPAD Hotkeys: Drum Kit | ||
# https://en.wikipedia.org/wiki/General_MIDI#Percussion | ||
|
||
from midi import Midi | ||
|
||
app = { | ||
'name' : 'Drum Kit', | ||
'order': 3, | ||
'macros' : [ | ||
# COLOR LABEL KEY SEQUENCE | ||
# 1st row ---------- | ||
(0x544408, 'HatFot', [Midi(44)]), | ||
(0x544408, 'HatCls', [Midi(42)]), | ||
(0x544408, 'HatOpn', [Midi(46)]), | ||
# 2nd row ---------- | ||
(0x04541B, 'XStick', [Midi(37)]), | ||
(0x095E06, 'Snare', [Midi(38)]), | ||
(0x04541B, 'Rod', [Midi(91)]), | ||
# 3rd row ---------- | ||
(0x000754, 'FlorTom', [Midi(43)]), | ||
(0x000754, 'LowTom', [Midi(47)]), | ||
(0x000754, 'HiTom', [Midi(48)]), | ||
# 4th row ---------- | ||
(0x540908, 'Bass', [Midi(35)]), | ||
(0x540908, 'Kick', [Midi(36)]), | ||
(0x04541B, 'Cowbell', [Midi(56)]) | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
VELOCITY = 127 | ||
|
||
class Midi: | ||
def __init__(self, note): | ||
self.note = note | ||
|
||
def press(self, macropad): | ||
if self.note < 0: | ||
macropad.midi.send(macropad.NoteOff(self.note, 0)) | ||
else: | ||
macropad.midi.send(macropad.NoteOn(self.note, VELOCITY)) | ||
|
||
def release(self, macropad): | ||
if self.note >= 0: | ||
macropad.midi.send(macropad.NoteOff(self.note, 0)) |