From 10db2678e54517f0994c7a3b69bf12680a581963 Mon Sep 17 00:00:00 2001 From: Harpo Date: Sat, 1 Oct 2022 11:16:36 -0700 Subject: [PATCH 1/6] Add release categories --- .github/release.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/release.yml diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..bb9d92e --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,25 @@ +changelog: + categories: + - title: Breaking Changes ๐Ÿช… + labels: + - breaking ๐Ÿ’” + + - title: New Features ๐ŸŽ‰ + labels: + - enhancement โž• + + - title: Bugfixes ๐Ÿ› + labels: + - bug ๐Ÿ› + + - title: Maintenance ๐Ÿ”ฉ + labels: + - maintenance ๐Ÿ”ง + - CI ๐Ÿฆพ + - CD ๐Ÿ—๏ธ + - production ๐ŸŽญ + - test ๐Ÿงช + + - title: Other Changes + labels: + - * From 7eb4ed5a1960d2eef9ea8515283df964f7bc08cb Mon Sep 17 00:00:00 2001 From: Harpo Date: Sat, 1 Oct 2022 12:16:31 -0700 Subject: [PATCH 2/6] Fix gld types for uint7 values --- ludwig/boards/gld.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ludwig/boards/gld.py b/ludwig/boards/gld.py index 114b620..86145da 100644 --- a/ludwig/boards/gld.py +++ b/ludwig/boards/gld.py @@ -18,7 +18,7 @@ def meters(self): self.sysex([0x12, 0x1]) @mixer - def fader(self, channel: uint7, volume: uint8): + def fader(self, channel: uint7, volume: uint7): self.nrpn(channel=channel, param=0x17, data1=volume, data2=0x7) @mixer @@ -26,7 +26,7 @@ def channel_assign_to_main_mix(self, channel: uint7, on: bool): self.nrpn(channel=channel, param=0x18, data1=0x7F if on else 0x3F, data2=0x7) @mixer - def aux_send_level(self, channel: uint7, snd: uint8, level: uint8): + def aux_send_level(self, channel: uint7, snd: uint8, level: uint7): self.nrpn(channel=channel, param=snd, data1=level, data2=0x7) @mixer From d2d009127efd7f59349073b36eeff2e8892c50a4 Mon Sep 17 00:00:00 2001 From: Harpo Date: Sat, 1 Oct 2022 13:10:27 -0700 Subject: [PATCH 3/6] XAir base: working mute / unmute !! --- ludwig/boards/__init__.py | 1 + ludwig/boards/xair.py | 48 +++++++++++++++++++++++++++++++++++++++ ludwig/main.py | 6 ++--- ludwig/types.py | 1 + 4 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 ludwig/boards/xair.py diff --git a/ludwig/boards/__init__.py b/ludwig/boards/__init__.py index da0f57a..42e2a95 100644 --- a/ludwig/boards/__init__.py +++ b/ludwig/boards/__init__.py @@ -1,2 +1,3 @@ from .qu24 import Qu24 from .gld import Gld +from .xair import XAir diff --git a/ludwig/boards/xair.py b/ludwig/boards/xair.py new file mode 100644 index 0000000..50a7eed --- /dev/null +++ b/ludwig/boards/xair.py @@ -0,0 +1,48 @@ +from ludwig import mixer, Mixer, Midi +from rtmidi.midiconstants import NOTE_ON, CONTROL_CHANGE +from ludwig.types import uint1, uint2, uint3, uint4, uint5, uint7, uint8 +from pydantic import conint + + +class XAir(Midi, Mixer): + """Behringer XAir mixer""" + + @mixer + def fader(self, channel: uint5, volume: uint7): + """Fade the channel + Fader CH CMD No. Value Comment + CH Faders 1 CC 0-15 0...127 Input Channels 1-16 + CH Faders 1 CC 16 0...127 AuxLineIn 17-18 / USB Recorder Playback (stereo) + CH Faders 1 CC 17-20 0...127 FX1-4 Return (stereo) + Send Faders 1 CC 21-26 0...127 Aux1-6 / Subgroup + Send Faders 1 CC 27-30 0...127 Fx1-4 + Main Fader 1 CC 31 0...127 Main LR (stereo) + """ + self.send([CONTROL_CHANGE | 0, channel, volume]) + + @mixer + def mute(self, channel: uint5): + """Mute the channel + Mute CH CMD No. Value Comment + CH Mutes 2 CC 0-15 0/127 Input Channels 1-16 + CH Mutes 2 CC 16 0/127 AuxLineIn 17-18 / USB Recorder Playback (stereo) + CH Mutes 2 CC 17-20 0/127 FX1-4 Return (stereo) + Send Mutes 2 CC 21-26 0/127 Aux1-6 / Subgroup + Send Mutes 2 CC 27-30 0...127 Fx1-4 + Main Mute 2 CC 31 0/127 Main LR (stereo) + """ + self.send([CONTROL_CHANGE | 1, channel, 127]) + + @mixer + def unmute(self, channel: uint7): + """Mute the channel + Mute CH CMD No. Value Comment + CH Mutes 2 CC 0-15 0/127 Input Channels 1-16 + CH Mutes 2 CC 16 0/127 AuxLineIn 17-18 / USB Recorder Playback (stereo) + CH Mutes 2 CC 17-20 0/127 FX1-4 Return (stereo) + Send Mutes 2 CC 21-26 0/127 Aux1-6 / Subgroup + Send Mutes 2 CC 27-30 0...127 Fx1-4 + Main Mute 2 CC 31 0/127 Main LR (stereo) + """ + self.send([CONTROL_CHANGE | 1, channel, 0]) + diff --git a/ludwig/main.py b/ludwig/main.py index af3416e..162ca43 100644 --- a/ludwig/main.py +++ b/ludwig/main.py @@ -1,5 +1,5 @@ from .mixer import Mixer -from .boards import Qu24 +from .boards import XAir from pluggy import PluginManager from argparse import ArgumentTypeError @@ -56,9 +56,7 @@ def main(): def get_plugin_manager(): pm = PluginManager('mixer') pm.add_hookspecs(Mixer) - pm.register(Qu24(hook=pm.hook, port='QU-24 MIDI 1', client_name='Qu24')) - # pm.register(Qu24(hook=pm.hook, port='Launchpad X:Launchpad X MIDI 2', client_name='Qu24')) - # pm.register(Qu24(hook=pm.hook, port='FreeWheeling:FreeWheeling IN 1', input_name='FreeWheeling:FreeWheeling OUT 1', client_name='Qu24')) + pm.register(XAir(hook=pm.hook, port='X18', client_name='XAir')) return pm diff --git a/ludwig/types.py b/ludwig/types.py index 02083eb..a38f318 100644 --- a/ludwig/types.py +++ b/ludwig/types.py @@ -10,6 +10,7 @@ uint2 = conint(ge=0, lt=4) uint3 = conint(ge=0, lt=8) uint4 = conint(ge=0, lt=16) +uint5 = conint(ge=0, lt=32) uint7 = conint(ge=0, lt=128) uint8 = conint(ge=0, lt=256) uint16 = conint(ge=0, lt=2**16) From ce7265aa9a3469ea947bfbf83a5a8378bb57c6bc Mon Sep 17 00:00:00 2001 From: Harpo Date: Sat, 1 Oct 2022 13:49:38 -0700 Subject: [PATCH 4/6] Use API_UNIX_JACK for jack MIDI control --- ludwig/midi.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ludwig/midi.py b/ludwig/midi.py index 233b0c2..941df32 100644 --- a/ludwig/midi.py +++ b/ludwig/midi.py @@ -1,6 +1,7 @@ from rtmidi.midiutil import open_midioutput, open_midiinput from rtmidi.midiconstants import CONTROL_CHANGE from ludwig.types import uint4, uint7, uint8 +from rtmidi import API_UNIX_JACK class Midi: @@ -28,10 +29,12 @@ def __init__( self.client_name = client_name self.channel = channel self.midi, self.name = open_midioutput( - port, client_name=client_name + '-output' + port, client_name=client_name + '-output', api=API_UNIX_JACK ) self.input, self.input_name = open_midiinput( - input_name if input_name else port, client_name=client_name + '-input' + input_name if input_name else port, + client_name=client_name + '-input', + api=API_UNIX_JACK, ) self.input.ignore_types(sysex=False) self.input.set_callback(self) From 4143db844cd22336dfd2a3ca5fda62c8fdd5d8c6 Mon Sep 17 00:00:00 2001 From: Harpo Date: Sat, 1 Oct 2022 15:53:20 -0700 Subject: [PATCH 5/6] Add XAir pan --- ludwig/boards/xair.py | 26 +++++++++++++++++++------- ludwig/main.py | 2 -- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/ludwig/boards/xair.py b/ludwig/boards/xair.py index 50a7eed..104aebb 100644 --- a/ludwig/boards/xair.py +++ b/ludwig/boards/xair.py @@ -10,16 +10,28 @@ class XAir(Midi, Mixer): @mixer def fader(self, channel: uint5, volume: uint7): """Fade the channel - Fader CH CMD No. Value Comment - CH Faders 1 CC 0-15 0...127 Input Channels 1-16 - CH Faders 1 CC 16 0...127 AuxLineIn 17-18 / USB Recorder Playback (stereo) - CH Faders 1 CC 17-20 0...127 FX1-4 Return (stereo) - Send Faders 1 CC 21-26 0...127 Aux1-6 / Subgroup - Send Faders 1 CC 27-30 0...127 Fx1-4 - Main Fader 1 CC 31 0...127 Main LR (stereo) + Fader CH CMD No. Value Comment + CH Faders 1 CC 0-15 0...127 Input Channels 1-16 + CH Faders 1 CC 16 0...127 AuxLineIn 17-18 / USB Recorder Playback (stereo) + CH Faders 1 CC 17-20 0...127 FX1-4 Return (stereo) + Send Faders 1 CC 21-26 0...127 Aux1-6 / Subgroup + Send Faders 1 CC 27-30 0...127 Fx1-4 + Main Fader 1 CC 31 0...127 Main LR (stereo) """ self.send([CONTROL_CHANGE | 0, channel, volume]) + @mixer + def pan(self, channel: uint5, pan: uint7): + """Pan the channel + Pan CH CMD No. Value Comment + CH PAN 3 CC 0-15 1...127 Panorama Input Channels 1-16, 64=center + CH PAN 3 CC 16 1...127 Balance AuxLineIn 17-18 / USB Recorder Playback, 64=center + CH PAN 3 CC 17-20 1...127 Balance FX1-4 Return, 64=center + Aux PAN (Subgroup) 3 CC 21-26 1...127 Panorama Aux1-6 / Subgroup, 64=center + Main Balance 3 CC 31 1...127 Balance Main LR, 64=center + """ + self.send([CONTROL_CHANGE | 2, channel, pan]) + @mixer def mute(self, channel: uint5): """Mute the channel diff --git a/ludwig/main.py b/ludwig/main.py index 162ca43..2b4381d 100644 --- a/ludwig/main.py +++ b/ludwig/main.py @@ -36,8 +36,6 @@ def main(): action='store_true', help='unmute the channel(s)', ) - args = parser.parse_args() - args = parser.parse_args() # print(args) for c in args.channels: From 2be2bd522c24d58aa599cf478c0eba0d2916dea4 Mon Sep 17 00:00:00 2001 From: Harpo Date: Sat, 1 Oct 2022 17:29:15 -0700 Subject: [PATCH 6/6] Update docstrings --- ludwig/boards/xair.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/ludwig/boards/xair.py b/ludwig/boards/xair.py index 104aebb..39f886d 100644 --- a/ludwig/boards/xair.py +++ b/ludwig/boards/xair.py @@ -35,26 +35,26 @@ def pan(self, channel: uint5, pan: uint7): @mixer def mute(self, channel: uint5): """Mute the channel - Mute CH CMD No. Value Comment - CH Mutes 2 CC 0-15 0/127 Input Channels 1-16 - CH Mutes 2 CC 16 0/127 AuxLineIn 17-18 / USB Recorder Playback (stereo) - CH Mutes 2 CC 17-20 0/127 FX1-4 Return (stereo) - Send Mutes 2 CC 21-26 0/127 Aux1-6 / Subgroup - Send Mutes 2 CC 27-30 0...127 Fx1-4 - Main Mute 2 CC 31 0/127 Main LR (stereo) + Mute CH CMD No. Value Comment + CH Mutes 2 CC 0-15 127 Input Channels 1-16 + CH Mutes 2 CC 16 127 AuxLineIn 17-18 / USB Recorder Playback (stereo) + CH Mutes 2 CC 17-20 127 FX1-4 Return (stereo) + Send Mutes 2 CC 21-26 127 Aux1-6 / Subgroup + Send Mutes 2 CC 27-30 127 Fx1-4 + Main Mute 2 CC 31 127 Main LR (stereo) """ self.send([CONTROL_CHANGE | 1, channel, 127]) @mixer - def unmute(self, channel: uint7): - """Mute the channel - Mute CH CMD No. Value Comment - CH Mutes 2 CC 0-15 0/127 Input Channels 1-16 - CH Mutes 2 CC 16 0/127 AuxLineIn 17-18 / USB Recorder Playback (stereo) - CH Mutes 2 CC 17-20 0/127 FX1-4 Return (stereo) - Send Mutes 2 CC 21-26 0/127 Aux1-6 / Subgroup - Send Mutes 2 CC 27-30 0...127 Fx1-4 - Main Mute 2 CC 31 0/127 Main LR (stereo) + def unmute(self, channel: uint5): + """Unmute the channel + Mute CH CMD No. Value Comment + CH Mutes 2 CC 0-15 0 Input Channels 1-16 + CH Mutes 2 CC 16 0 AuxLineIn 17-18 / USB Recorder Playback (stereo) + CH Mutes 2 CC 17-20 0 FX1-4 Return (stereo) + Send Mutes 2 CC 21-26 0 Aux1-6 / Subgroup + Send Mutes 2 CC 27-30 0 Fx1-4 + Main Mute 2 CC 31 0 Main LR (stereo) """ self.send([CONTROL_CHANGE | 1, channel, 0])