|
@@ -3,59 +3,77 @@ import wx |
|
|
|
|
|
|
|
|
def sendOSCSafe(channel, data): |
|
|
def sendOSCSafe(channel, data): |
|
|
try: |
|
|
try: |
|
|
|
|
|
print channel, data |
|
|
sendOSCMsg(channel, data) |
|
|
sendOSCMsg(channel, data) |
|
|
except OSCClientError: |
|
|
except OSCClientError: |
|
|
print "OSC comms error" |
|
|
print "OSC comms error" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class OSCSlider(wx.Panel): |
|
|
class OSCSlider(wx.Panel): |
|
|
''' A GUI slider ''' |
|
|
|
|
|
def __init__(self, parent, label, min_value=0, max_value=1, default_value=0, align=True): |
|
|
|
|
|
''' Constructor ''' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
""" A GUI slider """ |
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, parent, label, min_value=0, max_value=1, default_value=0, align=True, rescale=100.): |
|
|
|
|
|
""" Constructor """ |
|
|
|
|
|
self.rescale = rescale |
|
|
wx.Panel.__init__(self, parent) |
|
|
wx.Panel.__init__(self, parent) |
|
|
sizer=wx.BoxSizer(wx.HORIZONTAL) |
|
|
|
|
|
label=wx.StaticText(self, label=label, size=(100,15) if align else None) |
|
|
|
|
|
|
|
|
sizer = wx.BoxSizer(wx.HORIZONTAL) |
|
|
|
|
|
label = wx.StaticText(self, label=label, size=(100, 15) if align else None) |
|
|
sizer.Add(label, 0, wx.RIGHT, 10) |
|
|
sizer.Add(label, 0, wx.RIGHT, 10) |
|
|
self.slider=wx.Slider(self, value=default_value*100, minValue=min_value*100, maxValue=max_value*100) |
|
|
|
|
|
|
|
|
self.slider = wx.Slider(self, value=default_value * self.rescale, |
|
|
|
|
|
minValue=min_value * self.rescale, maxValue=max_value * self.rescale) |
|
|
sizer.Add(self.slider, 1, wx.EXPAND) |
|
|
sizer.Add(self.slider, 1, wx.EXPAND) |
|
|
|
|
|
|
|
|
self.SetSizerAndFit(sizer) |
|
|
self.SetSizerAndFit(sizer) |
|
|
self.Bind=self.slider.Bind |
|
|
|
|
|
|
|
|
self.Bind = self.slider.Bind |
|
|
|
|
|
|
|
|
def GetValue(self): |
|
|
def GetValue(self): |
|
|
return self.slider.GetValue()/100. |
|
|
|
|
|
|
|
|
""" Make sure that we rescale """ |
|
|
|
|
|
return self.slider.GetValue() / self.rescale |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CommsPanel(wx.Panel): |
|
|
class CommsPanel(wx.Panel): |
|
|
|
|
|
|
|
|
""" OSC comms """ |
|
|
""" OSC comms """ |
|
|
|
|
|
|
|
|
def __init__(self, parent): |
|
|
def __init__(self, parent): |
|
|
wx.Panel.__init__(self, parent) |
|
|
wx.Panel.__init__(self, parent) |
|
|
sizer = wx.BoxSizer(wx.HORIZONTAL) |
|
|
sizer = wx.BoxSizer(wx.HORIZONTAL) |
|
|
|
|
|
|
|
|
label = wx.StaticText(self, label="Sync:") |
|
|
label = wx.StaticText(self, label="Sync:") |
|
|
font = label.GetFont(); font.SetWeight(wx.BOLD); label.SetFont(font) |
|
|
|
|
|
sizer.Add(label, 0, wx.TOP|wx.BOTTOM|wx.RIGHT|wx.EXPAND, 5) |
|
|
|
|
|
|
|
|
font = label.GetFont() |
|
|
|
|
|
font.SetWeight(wx.BOLD) |
|
|
|
|
|
label.SetFont(font) |
|
|
|
|
|
sizer.Add(label, 0, wx.TOP | wx.BOTTOM | wx.RIGHT | wx.EXPAND, 5) |
|
|
|
|
|
|
|
|
choices=["Master", "Minion"] |
|
|
|
|
|
self.master= wx.ComboBox(self, choices=choices, style=wx.CB_READONLY, size=(25,25)) |
|
|
|
|
|
|
|
|
choices = ["Master", "Minion"] |
|
|
|
|
|
self.master = wx.ComboBox(self, choices=choices, style=wx.CB_READONLY, size=(25, 25)) |
|
|
sizer.Add(self.master, 1, wx.ALL, 3) |
|
|
sizer.Add(self.master, 1, wx.ALL, 3) |
|
|
self.master.SetValue(choices[0]) |
|
|
self.master.SetValue(choices[0]) |
|
|
|
|
|
|
|
|
self.ip=wx.TextCtrl(self, value="127.0.0.1") |
|
|
|
|
|
|
|
|
self.ip = wx.TextCtrl(self, value="127.0.0.1") |
|
|
sizer.Add(self.ip, 0, wx.ALL, 3) |
|
|
sizer.Add(self.ip, 0, wx.ALL, 3) |
|
|
|
|
|
|
|
|
self.port=wx.TextCtrl(self, value="9000") |
|
|
|
|
|
|
|
|
self.port = wx.TextCtrl(self, value="9000") |
|
|
sizer.Add(self.port, 0, wx.ALL, 3) |
|
|
sizer.Add(self.port, 0, wx.ALL, 3) |
|
|
|
|
|
|
|
|
self.SetSizerAndFit(sizer) |
|
|
self.SetSizerAndFit(sizer) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class InputPanel(wx.Panel): |
|
|
class InputPanel(wx.Panel): |
|
|
''' Handle the ADC input settings ''' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
""" Handle the ADC input settings """ |
|
|
|
|
|
|
|
|
def __init__(self, parent): |
|
|
def __init__(self, parent): |
|
|
''' Constructor ''' |
|
|
|
|
|
|
|
|
""" Constructor """ |
|
|
wx.Panel.__init__(self, parent) |
|
|
wx.Panel.__init__(self, parent) |
|
|
sizer = wx.BoxSizer(wx.HORIZONTAL) |
|
|
sizer = wx.BoxSizer(wx.HORIZONTAL) |
|
|
|
|
|
|
|
|
label = wx.StaticText(self, label="Input:") |
|
|
label = wx.StaticText(self, label="Input:") |
|
|
font = label.GetFont(); font.SetWeight(wx.BOLD); label.SetFont(font) |
|
|
|
|
|
sizer.Add(label, 0, wx.TOP|wx.BOTTOM|wx.RIGHT, 5) |
|
|
|
|
|
|
|
|
font = label.GetFont() |
|
|
|
|
|
font.SetWeight(wx.BOLD) |
|
|
|
|
|
label.SetFont(font) |
|
|
|
|
|
sizer.Add(label, 0, wx.TOP | wx.BOTTOM | wx.RIGHT, 5) |
|
|
|
|
|
|
|
|
self.gain = OSCSlider(self, "Gain", default_value=.5, align=False) |
|
|
self.gain = OSCSlider(self, "Gain", default_value=.5, align=False) |
|
|
sizer.Add(self.gain, 1, wx.ALL, 5) |
|
|
sizer.Add(self.gain, 1, wx.ALL, 5) |
|
@@ -63,9 +81,10 @@ class InputPanel(wx.Panel): |
|
|
sizer.Add(self.thru, 1, wx.ALL, 5) |
|
|
sizer.Add(self.thru, 1, wx.ALL, 5) |
|
|
|
|
|
|
|
|
self.mute = wx.ToggleButton(self, 0, "Mute") |
|
|
self.mute = wx.ToggleButton(self, 0, "Mute") |
|
|
|
|
|
# self.mute.SetValue(1) |
|
|
sizer.Add(self.mute, 0) |
|
|
sizer.Add(self.mute, 0) |
|
|
self.SetSizerAndFit(sizer) |
|
|
self.SetSizerAndFit(sizer) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.gain.Bind(wx.EVT_SCROLL, self.update) |
|
|
self.gain.Bind(wx.EVT_SCROLL, self.update) |
|
|
self.thru.Bind(wx.EVT_SCROLL, self.update) |
|
|
self.thru.Bind(wx.EVT_SCROLL, self.update) |
|
|
self.mute.Bind(wx.EVT_TOGGLEBUTTON, self.update) |
|
|
self.mute.Bind(wx.EVT_TOGGLEBUTTON, self.update) |
|
@@ -74,30 +93,36 @@ class InputPanel(wx.Panel): |
|
|
|
|
|
|
|
|
def update(self, evt=None): |
|
|
def update(self, evt=None): |
|
|
""" Send OSC messages """ |
|
|
""" Send OSC messages """ |
|
|
gain=self.gain.GetValue() |
|
|
|
|
|
thru=self.thru.GetValue() |
|
|
|
|
|
if self.mute.GetValue(): gain, thru = 0.,0. |
|
|
|
|
|
|
|
|
gain = self.gain.GetValue() |
|
|
|
|
|
thru = self.thru.GetValue() |
|
|
|
|
|
if self.mute.GetValue(): |
|
|
|
|
|
gain, thru = 0., 0. |
|
|
sendOSCSafe("/input", [gain, thru]) |
|
|
sendOSCSafe("/input", [gain, thru]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class DelayPanel(wx.Panel): |
|
|
class DelayPanel(wx.Panel): |
|
|
''' Handle the ADC input settings ''' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
""" Handle the ADC input settings """ |
|
|
|
|
|
|
|
|
def __init__(self, parent): |
|
|
def __init__(self, parent): |
|
|
''' Constructor ''' |
|
|
|
|
|
|
|
|
""" Constructor """ |
|
|
wx.Panel.__init__(self, parent) |
|
|
wx.Panel.__init__(self, parent) |
|
|
sizer = wx.BoxSizer(wx.HORIZONTAL) |
|
|
sizer = wx.BoxSizer(wx.HORIZONTAL) |
|
|
|
|
|
|
|
|
label = wx.StaticText(self, label="Loop:") |
|
|
label = wx.StaticText(self, label="Loop:") |
|
|
font = label.GetFont(); font.SetWeight(wx.BOLD); label.SetFont(font) |
|
|
|
|
|
sizer.Add(label, 0, wx.TOP|wx.BOTTOM|wx.RIGHT, 5) |
|
|
|
|
|
|
|
|
font = label.GetFont() |
|
|
|
|
|
font.SetWeight(wx.BOLD) |
|
|
|
|
|
label.SetFont(font) |
|
|
|
|
|
sizer.Add(label, 0, wx.TOP | wx.BOTTOM | wx.RIGHT, 5) |
|
|
|
|
|
|
|
|
self.delayTime=OSCSlider(self, "Time", default_value=1, max_value=10, align=False) |
|
|
|
|
|
sizer.Add(self.delayTime, 1, wx.EXPAND|wx.ALL, 5) |
|
|
|
|
|
|
|
|
self.delayTime = OSCSlider(self, "Time", default_value=1, max_value=10, align=False) |
|
|
|
|
|
sizer.Add(self.delayTime, 1, wx.ALL, 5) |
|
|
|
|
|
|
|
|
self.feedback=OSCSlider(self, "Hold", default_value=.99, align=False) |
|
|
|
|
|
sizer.Add(self.feedback, 1, wx.EXPAND|wx.ALL, 5) |
|
|
|
|
|
|
|
|
self.feedback = OSCSlider(self, "Hold", default_value=.99, align=False) |
|
|
|
|
|
sizer.Add(self.feedback, 1, wx.ALL, 5) |
|
|
|
|
|
|
|
|
self.metronome=wx.ToggleButton(self, 0, "Click") |
|
|
|
|
|
sizer.Add(self.metronome, 0, wx.EXPAND|wx.ALL, 5) |
|
|
|
|
|
|
|
|
self.metronome = wx.ToggleButton(self, 0, "Metronome") |
|
|
|
|
|
sizer.Add(self.metronome, 0) |
|
|
|
|
|
|
|
|
self.SetSizerAndFit(sizer) |
|
|
self.SetSizerAndFit(sizer) |
|
|
self.delayTime.Bind(wx.EVT_SCROLL, self.update) |
|
|
self.delayTime.Bind(wx.EVT_SCROLL, self.update) |
|
@@ -107,53 +132,64 @@ class DelayPanel(wx.Panel): |
|
|
|
|
|
|
|
|
def update(self, evt): |
|
|
def update(self, evt): |
|
|
""" Send OSC messages """ |
|
|
""" Send OSC messages """ |
|
|
a=self.delayTime.GetValue() |
|
|
|
|
|
b=self.feedback.GetValue() |
|
|
|
|
|
|
|
|
a = self.delayTime.GetValue() |
|
|
|
|
|
b = self.feedback.GetValue() |
|
|
sendOSCSafe("/delay", [a, b]) |
|
|
sendOSCSafe("/delay", [a, b]) |
|
|
|
|
|
|
|
|
def switchMetronome(self, evt): |
|
|
def switchMetronome(self, evt): |
|
|
""" Send OSC messages """ |
|
|
""" Send OSC messages """ |
|
|
sendOSCSafe("/metronome", [int(self.metronome.GetValue())]) |
|
|
sendOSCSafe("/metronome", [int(self.metronome.GetValue())]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ButtonArray(wx.Panel): |
|
|
class ButtonArray(wx.Panel): |
|
|
''' Handle the ADC input settings ''' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
""" Handle the ADC input settings """ |
|
|
|
|
|
|
|
|
def __init__(self, parent, index): |
|
|
def __init__(self, parent, index): |
|
|
wx.Panel.__init__(self, parent) |
|
|
wx.Panel.__init__(self, parent) |
|
|
w=40 |
|
|
|
|
|
|
|
|
w = 40 |
|
|
sizer = wx.BoxSizer(wx.HORIZONTAL) |
|
|
sizer = wx.BoxSizer(wx.HORIZONTAL) |
|
|
self.record = wx.ToggleButton(self, 0, "Arm", size=(w,25)) |
|
|
|
|
|
|
|
|
self.record = wx.ToggleButton(self, 0, "Arm", size=(w, 25)) |
|
|
sizer.Add(self.record, 1, wx.ALL, 0) |
|
|
sizer.Add(self.record, 1, wx.ALL, 0) |
|
|
self.mute = wx.ToggleButton(self, 0, "Mute", size=(w,25)) |
|
|
|
|
|
|
|
|
self.mute = wx.ToggleButton(self, 0, "Mute", size=(w, 25)) |
|
|
sizer.Add(self.mute, 1, wx.ALL, 0) |
|
|
sizer.Add(self.mute, 1, wx.ALL, 0) |
|
|
self.clear = wx.Button(self, 0, "Clear", size=(w,25)) |
|
|
|
|
|
|
|
|
self.clear = wx.Button(self, 0, "Clear", size=(w, 25)) |
|
|
sizer.Add(self.clear, 1, wx.ALL, 0) |
|
|
sizer.Add(self.clear, 1, wx.ALL, 0) |
|
|
self.buttons=(self.record, self.mute, self.clear) |
|
|
|
|
|
|
|
|
self.buttons = (self.record, self.mute, self.clear) |
|
|
self.SetSizerAndFit(sizer) |
|
|
self.SetSizerAndFit(sizer) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Channel(wx.Panel): |
|
|
class Channel(wx.Panel): |
|
|
|
|
|
|
|
|
""" A single channel """ |
|
|
""" A single channel """ |
|
|
|
|
|
|
|
|
def __init__(self, parent, index): |
|
|
def __init__(self, parent, index): |
|
|
self.index=index |
|
|
|
|
|
|
|
|
self.index = index |
|
|
wx.Panel.__init__(self, parent) |
|
|
wx.Panel.__init__(self, parent) |
|
|
sizer = wx.BoxSizer(wx.VERTICAL) |
|
|
sizer = wx.BoxSizer(wx.VERTICAL) |
|
|
|
|
|
|
|
|
self.gain = OSCSlider(self, "Gain", default_value=1, max_value=1.3, align=False) |
|
|
self.gain = OSCSlider(self, "Gain", default_value=1, max_value=1.3, align=False) |
|
|
sizer.Add(self.gain, 0, wx.ALL|wx.EXPAND, 3) |
|
|
|
|
|
|
|
|
sizer.Add(self.gain, 0, wx.ALL | wx.EXPAND, 3) |
|
|
|
|
|
|
|
|
self.pan = OSCSlider(self, "Pan", default_value=0, min_value=-1, max_value=1, align=False) |
|
|
self.pan = OSCSlider(self, "Pan", default_value=0, min_value=-1, max_value=1, align=False) |
|
|
sizer.Add(self.pan, 0, wx.ALL|wx.EXPAND, 3) |
|
|
|
|
|
|
|
|
sizer.Add(self.pan, 0, wx.ALL | wx.EXPAND, 3) |
|
|
|
|
|
|
|
|
self.fxsend = OSCSlider(self, "Dry/Wet", default_value=0, min_value=0, max_value=1, align=False) |
|
|
self.fxsend = OSCSlider(self, "Dry/Wet", default_value=0, min_value=0, max_value=1, align=False) |
|
|
sizer.Add(self.fxsend, 0, wx.ALL|wx.EXPAND, 3) |
|
|
|
|
|
|
|
|
sizer.Add(self.fxsend, 0, wx.ALL | wx.EXPAND, 3) |
|
|
|
|
|
|
|
|
self.buttons=ButtonArray(self, index) |
|
|
|
|
|
|
|
|
self.buttons = ButtonArray(self, index) |
|
|
self.record, self.mute, self.clear = self.buttons.buttons |
|
|
self.record, self.mute, self.clear = self.buttons.buttons |
|
|
sizer.Add(self.buttons, 0, wx.ALL|wx.EXPAND, 3) |
|
|
|
|
|
|
|
|
sizer.Add(self.buttons, 0, wx.ALL | wx.EXPAND, 3) |
|
|
|
|
|
|
|
|
choices=["1 bar", "2 bars", "4 bars", "Dephase", "1/2 rate"] |
|
|
|
|
|
self.speed= wx.ComboBox(self, choices=choices, style=wx.CB_READONLY, size=(25,25)) |
|
|
|
|
|
self.speed.SetValue("1 bar") |
|
|
|
|
|
sizer.Add(self.speed, 0, wx.ALL|wx.EXPAND, 3) |
|
|
|
|
|
|
|
|
choices = ["1 bar", "2 bars", "4 bars", "Dephase", "1/2 rate"] |
|
|
|
|
|
self.speed = wx.ComboBox(self, choices=choices, style=wx.CB_READONLY, size=(25, 25)) |
|
|
|
|
|
self.speed.SetValue(choices[0]) |
|
|
|
|
|
sizer.Add(self.speed, 0, wx.ALL | wx.EXPAND, 3) |
|
|
|
|
|
|
|
|
|
|
|
choices = ["Live ->", "Live <->", "loop1.wav", "loop2.wav", "loop3.wav"] |
|
|
|
|
|
self.speed = wx.ComboBox(self, choices=choices, style=wx.CB_READONLY, size=(25, 25)) |
|
|
|
|
|
self.speed.SetValue(choices[0]) |
|
|
|
|
|
sizer.Add(self.speed, 0, wx.ALL | wx.EXPAND, 3) |
|
|
|
|
|
|
|
|
self.SetSizerAndFit(sizer) |
|
|
self.SetSizerAndFit(sizer) |
|
|
|
|
|
|
|
@@ -164,27 +200,30 @@ class Channel(wx.Panel): |
|
|
self.update() |
|
|
self.update() |
|
|
|
|
|
|
|
|
def update(self, evt=None): |
|
|
def update(self, evt=None): |
|
|
gain=self.gain.GetValue() |
|
|
|
|
|
pan=self.pan.GetValue() |
|
|
|
|
|
fxsend=self.fxsend.GetValue() |
|
|
|
|
|
if self.mute.GetValue(): gain=0.0; |
|
|
|
|
|
|
|
|
gain = self.gain.GetValue() |
|
|
|
|
|
pan = self.pan.GetValue() |
|
|
|
|
|
fxsend = self.fxsend.GetValue() |
|
|
|
|
|
if self.mute.GetValue(): |
|
|
|
|
|
gain = 0.0 |
|
|
sendOSCSafe("/channel", [self.index, gain, pan, fxsend]) |
|
|
sendOSCSafe("/channel", [self.index, gain, pan, fxsend]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Mixer(wx.Panel): |
|
|
class Mixer(wx.Panel): |
|
|
''' All the channels ''' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
""" All the channels """ |
|
|
|
|
|
|
|
|
def __init__(self, parent): |
|
|
def __init__(self, parent): |
|
|
''' Constructor ''' |
|
|
|
|
|
|
|
|
""" Constructor """ |
|
|
wx.Panel.__init__(self, parent) |
|
|
wx.Panel.__init__(self, parent) |
|
|
sizer = wx.BoxSizer(wx.HORIZONTAL) |
|
|
sizer = wx.BoxSizer(wx.HORIZONTAL) |
|
|
|
|
|
|
|
|
self.channels=[] |
|
|
|
|
|
|
|
|
self.channels = [] |
|
|
for i in range(4): |
|
|
for i in range(4): |
|
|
c=Channel(self, index=i) |
|
|
|
|
|
|
|
|
c = Channel(self, index=i) |
|
|
c.record.Bind(wx.EVT_TOGGLEBUTTON, self.switch_record) |
|
|
c.record.Bind(wx.EVT_TOGGLEBUTTON, self.switch_record) |
|
|
c.record.index=i |
|
|
|
|
|
|
|
|
c.record.index = i |
|
|
c.clear.Bind(wx.EVT_BUTTON, self.clear_channel) |
|
|
c.clear.Bind(wx.EVT_BUTTON, self.clear_channel) |
|
|
c.clear.index=i |
|
|
|
|
|
|
|
|
c.clear.index = i |
|
|
self.channels.append(c) |
|
|
self.channels.append(c) |
|
|
sizer.Add(c, 1, wx.EXPAND) |
|
|
sizer.Add(c, 1, wx.EXPAND) |
|
|
|
|
|
|
|
@@ -204,68 +243,82 @@ class Mixer(wx.Panel): |
|
|
index = evt.GetEventObject().index |
|
|
index = evt.GetEventObject().index |
|
|
sendOSCSafe("/clear", [index]) |
|
|
sendOSCSafe("/clear", [index]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class FXPanel(wx.Panel): |
|
|
class FXPanel(wx.Panel): |
|
|
''' Effects chain ''' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
""" Effects chain """ |
|
|
|
|
|
|
|
|
def __init__(self, parent): |
|
|
def __init__(self, parent): |
|
|
''' Constructor ''' |
|
|
|
|
|
|
|
|
""" Constructor """ |
|
|
wx.Panel.__init__(self, parent) |
|
|
wx.Panel.__init__(self, parent) |
|
|
sizer = wx.BoxSizer(wx.HORIZONTAL) |
|
|
sizer = wx.BoxSizer(wx.HORIZONTAL) |
|
|
|
|
|
|
|
|
label = wx.StaticText(self, label="Filter:") |
|
|
|
|
|
font = label.GetFont(); font.SetWeight(wx.BOLD); label.SetFont(font) |
|
|
|
|
|
sizer.Add(label, 0, wx.EXPAND|wx.TOP|wx.BOTTOM|wx.RIGHT, 5) |
|
|
|
|
|
|
|
|
label = wx.StaticText(self, label="FX:") |
|
|
|
|
|
font = label.GetFont() |
|
|
|
|
|
font.SetWeight(wx.BOLD) |
|
|
|
|
|
label.SetFont(font) |
|
|
|
|
|
sizer.Add(label, 0, wx.EXPAND | wx.TOP | wx.BOTTOM | wx.RIGHT, 5) |
|
|
|
|
|
|
|
|
self.lpf=OSCSlider(self, "", default_value=0, align=False) |
|
|
|
|
|
sizer.Add(self.lpf, 2, wx.EXPAND|wx.ALL, 5) |
|
|
|
|
|
|
|
|
self.lpf = OSCSlider(self, "Lo-pass", default_value=.5, align=False) |
|
|
|
|
|
sizer.Add(self.lpf, 2, wx.EXPAND | wx.ALL, 5) |
|
|
self.lpf.Bind(wx.EVT_SCROLL, self.update) |
|
|
self.lpf.Bind(wx.EVT_SCROLL, self.update) |
|
|
|
|
|
|
|
|
|
|
|
self.hpf = OSCSlider(self, "Hi-pass", min_value=0, default_value=.5, align=False) |
|
|
|
|
|
sizer.Add(self.hpf, 2, wx.EXPAND | wx.ALL, 5) |
|
|
|
|
|
self.hpf.Bind(wx.EVT_SCROLL, self.update) |
|
|
|
|
|
|
|
|
|
|
|
self.reverb = OSCSlider(self, "Reverb", default_value=.5, align=False) |
|
|
|
|
|
sizer.Add(self.reverb, 2, wx.EXPAND | wx.ALL, 5) |
|
|
|
|
|
self.reverb.Bind(wx.EVT_SCROLL, self.update) |
|
|
|
|
|
|
|
|
self.SetSizerAndFit(sizer) |
|
|
self.SetSizerAndFit(sizer) |
|
|
self.update(None) |
|
|
self.update(None) |
|
|
|
|
|
|
|
|
def update(self, evt): |
|
|
def update(self, evt): |
|
|
a=self.lpf.GetValue() |
|
|
|
|
|
sendOSCSafe("/fx", [a]) |
|
|
|
|
|
|
|
|
a = self.lpf.GetValue() |
|
|
|
|
|
a2 = self.hpf.GetValue() |
|
|
|
|
|
b = self.reverb.GetValue() |
|
|
|
|
|
sendOSCSafe("/fx", [a, a2, b]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class OutputPanel(wx.Panel): |
|
|
class OutputPanel(wx.Panel): |
|
|
''' Handle the ADC input settings ''' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
""" Handle the ADC input settings """ |
|
|
|
|
|
|
|
|
def __init__(self, parent): |
|
|
def __init__(self, parent): |
|
|
''' Constructor ''' |
|
|
|
|
|
|
|
|
""" Constructor """ |
|
|
wx.Panel.__init__(self, parent) |
|
|
wx.Panel.__init__(self, parent) |
|
|
sizer = wx.BoxSizer(wx.HORIZONTAL) |
|
|
sizer = wx.BoxSizer(wx.HORIZONTAL) |
|
|
|
|
|
|
|
|
label = wx.StaticText(self, label="Output:") |
|
|
label = wx.StaticText(self, label="Output:") |
|
|
font = label.GetFont(); font.SetWeight(wx.BOLD); label.SetFont(font) |
|
|
|
|
|
sizer.Add(label, 0, wx.TOP|wx.BOTTOM|wx.RIGHT, 5) |
|
|
|
|
|
|
|
|
font = label.GetFont() |
|
|
|
|
|
font.SetWeight(wx.BOLD) |
|
|
|
|
|
label.SetFont(font) |
|
|
|
|
|
sizer.Add(label, 0, wx.TOP | wx.BOTTOM | wx.RIGHT, 5) |
|
|
|
|
|
|
|
|
self.level=OSCSlider(self, "Level", default_value=.8, align=False) |
|
|
|
|
|
sizer.Add(self.level, 2, wx.EXPAND|wx.ALL, 5) |
|
|
|
|
|
|
|
|
|
|
|
#self.gauge = wx.Gauge(self, size=(40,10)) |
|
|
|
|
|
#sizer.Add(self.gauge, 1, wx.EXPAND|wx.ALL, 5) |
|
|
|
|
|
|
|
|
self.level = OSCSlider(self, "Level", default_value=.8, align=False) |
|
|
|
|
|
sizer.Add(self.level, 2, wx.EXPAND | wx.ALL, 5) |
|
|
|
|
|
self.level.Bind(wx.EVT_SCROLL, self.update) |
|
|
|
|
|
|
|
|
self.SetSizerAndFit(sizer) |
|
|
self.SetSizerAndFit(sizer) |
|
|
|
|
|
|
|
|
""" |
|
|
|
|
|
def update(self, evt): |
|
|
def update(self, evt): |
|
|
a=self.delayTimeGetValue() |
|
|
|
|
|
b=self.feedbackGetValue() |
|
|
|
|
|
sendOSCSafe("/delay", [a, b]) |
|
|
|
|
|
""" |
|
|
|
|
|
|
|
|
a = self.level.GetValue() |
|
|
|
|
|
sendOSCSafe("/master", [a]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MainGUI(wx.Frame): |
|
|
class MainGUI(wx.Frame): |
|
|
|
|
|
|
|
|
""" A simple GUI to talk to Chuck """ |
|
|
""" A simple GUI to talk to Chuck """ |
|
|
|
|
|
|
|
|
def __init__(self): |
|
|
def __init__(self): |
|
|
""" Constructor """ |
|
|
""" Constructor """ |
|
|
# Build the interface |
|
|
# Build the interface |
|
|
self.app = wx.App(False) |
|
|
self.app = wx.App(False) |
|
|
self.build() |
|
|
self.build() |
|
|
|
|
|
|
|
|
def run(self): self.app.MainLoop() |
|
|
|
|
|
|
|
|
|
|
|
def update_vu(self, a,b,c,d): |
|
|
|
|
|
level=int(1000000*c[0]) |
|
|
|
|
|
self.output.gauge.SetValue(level) |
|
|
|
|
|
|
|
|
def run(self): |
|
|
|
|
|
self.app.MainLoop() |
|
|
|
|
|
|
|
|
def build(self): |
|
|
def build(self): |
|
|
""" Builds the various pieces of the GUI """ |
|
|
""" Builds the various pieces of the GUI """ |
|
@@ -274,40 +327,18 @@ class MainGUI(wx.Frame): |
|
|
|
|
|
|
|
|
# The main sizer |
|
|
# The main sizer |
|
|
self.mainsizer = wx.BoxSizer(wx.VERTICAL) |
|
|
self.mainsizer = wx.BoxSizer(wx.VERTICAL) |
|
|
|
|
|
self.components = [] |
|
|
|
|
|
components = (CommsPanel, InputPanel, DelayPanel, Mixer, FXPanel, OutputPanel) |
|
|
|
|
|
|
|
|
self.commsPanel = CommsPanel(self) |
|
|
|
|
|
self.mainsizer.Add(self.commsPanel, 0, wx.EXPAND|wx.ALL, 5) |
|
|
|
|
|
|
|
|
|
|
|
line=wx.StaticLine(self); self.mainsizer.Add(line, 0, wx.EXPAND|wx.ALL, 1) |
|
|
|
|
|
|
|
|
|
|
|
self.inputPanel = InputPanel(self) |
|
|
|
|
|
self.mainsizer.Add(self.inputPanel, 0, wx.EXPAND|wx.ALL, 5) |
|
|
|
|
|
|
|
|
|
|
|
line=wx.StaticLine(self); self.mainsizer.Add(line, 0, wx.EXPAND|wx.ALL, 1) |
|
|
|
|
|
|
|
|
|
|
|
self.delayPanel = DelayPanel(self) |
|
|
|
|
|
self.mainsizer.Add(self.delayPanel, 0, wx.EXPAND|wx.ALL, 5) |
|
|
|
|
|
|
|
|
|
|
|
line=wx.StaticLine(self); self.mainsizer.Add(line, 0, wx.EXPAND|wx.ALL, 1) |
|
|
|
|
|
|
|
|
for index, ctype in enumerate(components): |
|
|
|
|
|
if index>0: self.mainsizer.Add(wx.StaticLine(self), 0, wx.EXPAND | wx.ALL, 1) |
|
|
|
|
|
c = ctype(self) |
|
|
|
|
|
self.components.append(c) |
|
|
|
|
|
self.mainsizer.Add(c, 0, wx.EXPAND | wx.ALL, 5) |
|
|
|
|
|
|
|
|
self.mixer = Mixer(self) |
|
|
|
|
|
self.mainsizer.Add(self.mixer, 0, wx.EXPAND|wx.ALL, 5) |
|
|
|
|
|
|
|
|
|
|
|
line=wx.StaticLine(self); self.mainsizer.Add(line, 0, wx.EXPAND|wx.ALL, 1) |
|
|
|
|
|
|
|
|
|
|
|
self.fx = FXPanel(self) |
|
|
|
|
|
self.mainsizer.Add(self.fx, 0, wx.EXPAND|wx.ALL, 5) |
|
|
|
|
|
|
|
|
|
|
|
line=wx.StaticLine(self); self.mainsizer.Add(line, 0, wx.EXPAND|wx.ALL, 1) |
|
|
|
|
|
|
|
|
|
|
|
self.output = OutputPanel(self) |
|
|
|
|
|
self.mainsizer.Add(self.output, 0, wx.EXPAND|wx.ALL, 5) |
|
|
|
|
|
|
|
|
|
|
|
# Put things together |
|
|
|
|
|
self.SetSizerAndFit(self.mainsizer) |
|
|
self.SetSizerAndFit(self.mainsizer) |
|
|
self.Show() |
|
|
self.Show() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def populate_left_panel(self): |
|
|
def populate_left_panel(self): |
|
|
""" Populate the left panel """ |
|
|
""" Populate the left panel """ |
|
|
# Status boxes |
|
|
# Status boxes |
|
@@ -319,8 +350,6 @@ class MainGUI(wx.Frame): |
|
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
|
if __name__ == "__main__": |
|
|
initOSCClient(ip="127.0.0.1", port=9000) |
|
|
initOSCClient(ip="127.0.0.1", port=9000) |
|
|
g=MainGUI() |
|
|
|
|
|
#initOSCServer(ip="127.0.0.1", port=6649, mode=0) |
|
|
|
|
|
#setOSCHandler("/vu", g.update_vu) |
|
|
|
|
|
|
|
|
g = MainGUI() |
|
|
g.run() |
|
|
g.run() |
|
|
closeOSC() |
|
|
closeOSC() |