From e9e1efefc87ce4dd942fa7c83794a7b27ec3a13c Mon Sep 17 00:00:00 2001 From: sbahling Date: Sat, 3 Nov 2018 01:09:07 +0100 Subject: Serve as base OSC server for the Tascam Console Unit We remove the Ardour specific OSC mapping and create our own OSC API that will be consumed by OSC translators that communicate to specific applications. We only send the state of each control and set the state of each fader or led based on received commands. Logic for interpreting the control state will be moved to the OSC translator code. --- tascam_fw_console/strip.py | 42 ++++-------------------------------------- 1 file changed, 4 insertions(+), 38 deletions(-) (limited to 'tascam_fw_console/strip.py') diff --git a/tascam_fw_console/strip.py b/tascam_fw_console/strip.py index fe7ca75..f472199 100644 --- a/tascam_fw_console/strip.py +++ b/tascam_fw_console/strip.py @@ -22,7 +22,6 @@ from tascam_fw_console.fader import Fader from tascam_fw_console.encoder import Encoder -from tascam_fw_console import osc class Strip(): @@ -39,14 +38,13 @@ class Strip(): self._rec = False self.pan = 0.5 self.trimdb = 0.0 - self.encoder = Encoder() + self.encoder = Encoder('Strip {}'.format(self.num), + '/strip/encoder', + self.num, + ) self.fader = Fader(self) self.name = None - self.encoder_handlers = {'PAN': self.send_pan, - 'AUX1': self.send_trim, - } - @property def mute_led(self): return self.console.unit.strips[self.num].mute_led @@ -114,35 +112,3 @@ class Strip(): self.rec_led.turn_on() else: self.rec_led.turn_off() - - def send_pan(self, delta): - addr = '/strip/pan_stereo_position' - pan = self.pan + delta * 0.02 - if pan < 0: - pan = 0 - if pan > 1.0: - pan = 1.0 - osc.client.send_message(addr, (self.num, pan)) - - def recv_pan(self, pan): - print('Pan: {} {}'.format(self.num, pan)) - self.pan = pan - - def send_trim(self, delta): - addr = '/strip/trimdB' - trimdb = self.trimdb + delta * 0.5 - if trimdb < -20: - trimdb = -20 - if trimdb > 20: - trimdb = 20 - osc.client.send_message(addr, (self.num, trimdb)) - - def recv_trim(self, trimdb): - print('TrimdB: {} {}'.format(self.num, trimdb)) - self.trimdb = trimdb - - def handle_encoder(self, mode, delta): - self.encoder_handlers.get(mode, self.default_encoder_handler)(delta) - - def default_encoder_handler(self, delta): - print(delta) -- cgit v1.2.3