diff options
| author | sbahling <sbahling@mudgum.net> | 2018-11-03 01:09:07 +0100 |
|---|---|---|
| committer | sbahling <sbahling@mudgum.net> | 2018-11-03 01:09:07 +0100 |
| commit | e9e1efefc87ce4dd942fa7c83794a7b27ec3a13c (patch) | |
| tree | 00ded9a9e5b5460b8173505795ccc7568fc0ba2d /tascam_fw_console/strip.py | |
| parent | 7d490031c54458644eb459dbb390b10ea8de3334 (diff) | |
| download | tascam-fw-osc-e9e1efefc87ce4dd942fa7c83794a7b27ec3a13c.tar.gz tascam-fw-osc-e9e1efefc87ce4dd942fa7c83794a7b27ec3a13c.tar.xz tascam-fw-osc-e9e1efefc87ce4dd942fa7c83794a7b27ec3a13c.zip | |
Serve as base OSC server for the Tascam Console Unittascam_fw_console-0.2
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.
Diffstat (limited to 'tascam_fw_console/strip.py')
| -rw-r--r-- | tascam_fw_console/strip.py | 42 |
1 files changed, 4 insertions, 38 deletions
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) |
