-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# jack midi Use the `rtmidi.API_UNIX_JACK` for all connections. Exposed and closed #3 ## logging Added info / debug logging levels for `LaunchpadX`
- Loading branch information
Showing
10 changed files
with
302 additions
and
145 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
EMPTY = 0 # black | ||
INACTIVE = 1 # grey | ||
RECORDING = 5 # red | ||
PLAYING = 21 # green | ||
STOPPED = 43 # navy | ||
CUT = 13 # cut mode - yellow | ||
ERASE = 84 # orange | ||
PULSE = 53 # pink | ||
TAP = 37 # cyan | ||
GREEN = [ 123, 23, 64, 22, 76, 87, 21, 122 ] | ||
EMPTY = 0 # black | ||
INACTIVE = 1 # grey | ||
RECORDING = 5 # red | ||
PLAYING = 21 # green | ||
STOPPED = 43 # navy | ||
CUT = 13 # cut mode - yellow | ||
ERASE = 84 # orange | ||
PULSE = 53 # pink | ||
TAP = 37 # cyan | ||
GREEN = [123, 23, 64, 22, 76, 87, 21, 122] | ||
|
||
NUMBER_LOOPS = 32 | ||
NUMBER_SCENES = 8 | ||
NUMBER_SCENES = 8 |
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 |
---|---|---|
@@ -1,118 +1,120 @@ | ||
from pluggy import HookspecMarker | ||
from rtmidi.midiutil import open_midioutput | ||
from rtmidi import API_UNIX_JACK | ||
|
||
holospec = HookspecMarker('holophonor') | ||
|
||
|
||
class Holophonor: | ||
def __init__(self, hook, port, client_name='holo', plugins=[], **kwargs): | ||
self.hook = hook | ||
self.port = port | ||
self.midi, self.name = open_midioutput(self.port, client_name=client_name) | ||
self.midi, self.name = open_midioutput( | ||
self.port, client_name=client_name, api=API_UNIX_JACK | ||
) | ||
self.plugins = plugins | ||
self.loops = [None]*32 | ||
self.loops = [None] * 32 | ||
self.pulse = False | ||
self.scenes = [None]*8 | ||
self.scenes = [None] * 8 | ||
self.current_scene = None | ||
self.shift = False | ||
self.mutes = [False]*4 | ||
self.mutes = [False] * 4 | ||
self.overdub = False | ||
self.cut = False | ||
self.tap = False | ||
|
||
@holospec | ||
def playLoop(self, loop: int, volume: int): | ||
'''play loop at volume''' | ||
|
||
@holospec | ||
def stopLoop(self, loop: int): | ||
'''pause loop''' | ||
|
||
@holospec | ||
def recordLoop(self, loop: int): | ||
'''record loop''' | ||
|
||
@holospec | ||
def eraseLoop(self, loop: int): | ||
'''erase the selected loop''' | ||
|
||
@holospec | ||
def clearLoop(self, loop: int): | ||
'''clear the button on release for the selected loop''' | ||
|
||
@holospec | ||
def overdubLoop(self, loop: int): | ||
'''overdub the selected loop''' | ||
|
||
@holospec | ||
def recallScene(self, scene: int): | ||
'''recall a scene''' | ||
|
||
@holospec | ||
def storeScene(self, scene: int): | ||
'''store a scene''' | ||
|
||
@holospec | ||
def eraseScene(self, scene: int): | ||
'''erase a scene''' | ||
|
||
@holospec | ||
def clearScene(self, scene: int): | ||
'''release the scene button''' | ||
|
||
@holospec | ||
def toggleShift(self): | ||
'''toggle shift mode''' | ||
|
||
@holospec | ||
def toggleCut(self): | ||
'''toggle cut mode''' | ||
|
||
@holospec | ||
def toggleOverdub(self): | ||
'''toggle overdub mode''' | ||
|
||
@holospec | ||
def deletePulse(self): | ||
'''delete pulse''' | ||
|
||
@holospec | ||
def clearPulse(self): | ||
'''release pulse button''' | ||
|
||
@holospec | ||
def stopAllLoops(self): | ||
'''stop all loops''' | ||
|
||
@holospec | ||
def tapPulse(self): | ||
'''tap pulse''' | ||
|
||
@holospec | ||
def toggleMute(self, channel: int): | ||
'''toggle mute on channel''' | ||
|
||
@holospec | ||
def toggleFX(self, fx: int): | ||
'''toggle fx''' | ||
|
||
@holospec | ||
def setDrumPatch(self, patch: int): | ||
'''set drum pad patch''' | ||
|
||
@holospec | ||
def setDrumBank(self, bank: int): | ||
'''set drum pad bank''' | ||
|
||
@holospec | ||
def playNote(self, note: tuple): | ||
'''play a synth note''' | ||
|
||
@holospec | ||
def clearNote(self, note: tuple): | ||
'''clear button from note''' | ||
|
||
@holospec | ||
def close(self): | ||
'''close the connection''' | ||
|
||
|
Oops, something went wrong.