Browse Source

New DSP chain

master
Pete Shadbolt 10 years ago
parent
commit
3c44ccddee
3 changed files with 22 additions and 24 deletions
  1. +8
    -5
      main.ck
  2. +8
    -13
      main.py
  3. +6
    -6
      scratch.ck

+ 8
- 5
main.ck View File

@@ -1,12 +1,15 @@
// Effects chain // Effects chain
adc => Gain g => dac;
g => Gain feedback => DelayL delay => g;
Gain mixer => dac; // Main mixer
adc => Gain adcThru => mixer; // Monitor the input
adc => Gain feedback => DelayL delay => feedback; // Delay line
delay => Gain delaySend => mixer; // Connect delay to mixer


// Delay parameters // Delay parameters
10::second => delay.max; 10::second => delay.max;
5::second => delay.delay; 5::second => delay.delay;
1 => feedback.gain; 1 => feedback.gain;
1 => delay.gain;
.5 => delaySend.gain;
.5 => adcThru.gain;


// OSC listener class // OSC listener class
class OSCListener { class OSCListener {
@@ -22,8 +25,8 @@ class OSCListener {
// define child class Y // define child class Y
class InputListener extends OSCListener { class InputListener extends OSCListener {
fun void handle(OscEvent oe){ fun void handle(OscEvent oe){
oe.getFloat() => g.gain;
oe.getFloat() => float a;
oe.getFloat() => adc.gain;
oe.getFloat() => adcThru.gain;
<<< "Edit input" >>>; <<< "Edit input" >>>;
} }
} }


+ 8
- 13
main.py View File

@@ -30,27 +30,22 @@ class InputPanel(wx.Panel):
self.thru = OSCSlider(self, "Thru", default_value=.5, align=False) self.thru = OSCSlider(self, "Thru", default_value=.5, align=False)
sizer.Add(self.thru, 1, wx.ALL, 5) sizer.Add(self.thru, 1, wx.ALL, 5)


self.button = wx.Button(self, 1, "Kill input")
sizer.Add(self.button, 0)
self.mute = wx.ToggleButton(self, 1, "Mute")
sizer.Add(self.mute, 0)
self.SetSizerAndFit(sizer) self.SetSizerAndFit(sizer)
self.gain.slider.Bind(wx.EVT_SCROLL, self.update) self.gain.slider.Bind(wx.EVT_SCROLL, self.update)
self.thru.slider.Bind(wx.EVT_SCROLL, self.update) self.thru.slider.Bind(wx.EVT_SCROLL, self.update)
self.button.Bind(wx.EVT_BUTTON, self.kill)
self.update()

def kill(self, evt):
""" Kill input """
self.gain.slider.SetValue(0)
self.thru.slider.SetValue(0)
self.mute.Bind(wx.EVT_TOGGLEBUTTON, self.update)
self.update() self.update()


def update(self, evt=None): def update(self, evt=None):
""" Send OSC messages """ """ Send OSC messages """
a=self.gain.slider.GetValue()/100.
b=self.thru.slider.GetValue()/100.
gain=self.gain.slider.GetValue()/100.
thru=self.thru.slider.GetValue()/100.
if self.mute.GetValue(): gain, thru = 0.,0.
try: try:
sendOSCMsg("/input", [a, b])
sendOSCMsg("/input", [gain, thru])
except OSCClientError: except OSCClientError:
pass pass


@@ -65,7 +60,7 @@ class DelayPanel(wx.Panel):
font = label.GetFont(); font.SetWeight(wx.BOLD); label.SetFont(font) font = label.GetFont(); font.SetWeight(wx.BOLD); label.SetFont(font)
sizer.Add(label, 0, wx.TOP|wx.BOTTOM|wx.RIGHT, 5) sizer.Add(label, 0, wx.TOP|wx.BOTTOM|wx.RIGHT, 5)


self.delayTime=OSCSlider(self, "Delay time (s)", default_value=5, max_value=10)
self.delayTime=OSCSlider(self, "Delay time (s)", default_value=1, max_value=10)
sizer.Add(self.delayTime, 0, wx.EXPAND|wx.ALL, 5) sizer.Add(self.delayTime, 0, wx.EXPAND|wx.ALL, 5)


self.feedback=OSCSlider(self, "Feedback", default_value=.95) self.feedback=OSCSlider(self, "Feedback", default_value=.95)


+ 6
- 6
scratch.ck View File

@@ -1,16 +1,16 @@
// Effects chain // Effects chain
adc => Gain monitor => Gain mixer => dac; //Monitor
.5 => monitor.gain;

monitor => Gain feed => Gain feedback => DelayL delay => feedback;
delay => Gain attenuate => mixer;
Gain mixer => dac; // Main mixer
adc => Gain adcThru => mixer; // Monitor the input
adc => Gain feedback => DelayL delay => feedback; // Delay line
delay => Gain delaySend => mixer; // Connect delay to mixer


// Delay parameters // Delay parameters
2::second => delay.max; 2::second => delay.max;
1::second => delay.delay; 1::second => delay.delay;
.98 => feedback.gain; .98 => feedback.gain;
1 => delay.gain; 1 => delay.gain;
.5 => attenuate.gain;
.5 => delaySend.gain;
.5 => adcThru.gain;


while (true){ while (true){
1::second => now; 1::second => now;


Loading…
Cancel
Save