summaryrefslogtreecommitdiff
path: root/strips.py
diff options
context:
space:
mode:
authorsbahling <sbahling@cagafuego.fritz.box>2018-10-20 23:59:28 +0200
committersbahling <sbahling@cagafuego.fritz.box>2018-10-20 23:59:28 +0200
commit6effbc283b3fa5b34bd45045c81168afa979572c (patch)
treea57236c458c1833551b81bc94ccf8d82500b117c /strips.py
parent50ae6f1fdd4fd9e880435ff7e831f7461cb5302e (diff)
downloadtascam-fw-osc-6effbc283b3fa5b34bd45045c81168afa979572c.tar.gz
tascam-fw-osc-6effbc283b3fa5b34bd45045c81168afa979572c.tar.xz
tascam-fw-osc-6effbc283b3fa5b34bd45045c81168afa979572c.zip
Initial refactoring work
Diffstat (limited to 'strips.py')
-rw-r--r--strips.py56
1 files changed, 56 insertions, 0 deletions
diff --git a/strips.py b/strips.py
new file mode 100644
index 0000000..da656d1
--- /dev/null
+++ b/strips.py
@@ -0,0 +1,56 @@
+#!/usr/bin/env python3
+"""
+ Open Sound Control send/recieve daemon for Tascam Firewire control surface
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ :copyright: Copyright (c) 2012-2014 Scott Bahling
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License version 2 as
+ published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program (see the file COPYING); if not, write to the
+ Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ :license: GPL-2.0, see COPYING for details
+"""
+
+from faders import Fader
+
+class Strip():
+
+ def __init__(self, unit, num):
+ self.num = 0
+ self.mute = None
+ self.solo = None
+ self.select = None
+ self.recenable = False
+ self.pan = 0.5
+ self.fader = Fader(unit, self)
+ self.name = None
+
+ 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.send_message(addr, (self.num, pan))
+
+ def recv_pan(self, pan):
+ print('Pan: {} {}'.format(self.num, pan))
+ self.pan = pan
+
+
+def init_strips(unit):
+ strips = []
+ for strip_num in range(0, 9):
+ strips.append(Strip(unit, strip_num))
+
+ return strips