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
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
10::second => delay.max;
5::second => delay.delay;
1 => feedback.gain;
1 => delay.gain;
.5 => delaySend.gain;
.5 => adcThru.gain;

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

def update(self, evt=None):
""" 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:
sendOSCMsg("/input", [a, b])
sendOSCMsg("/input", [gain, thru])
except OSCClientError:
pass

@@ -65,7 +60,7 @@ class DelayPanel(wx.Panel):
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, "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)

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


+ 6
- 6
scratch.ck View File

@@ -1,16 +1,16 @@
// 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
2::second => delay.max;
1::second => delay.delay;
.98 => feedback.gain;
1 => delay.gain;
.5 => attenuate.gain;
.5 => delaySend.gain;
.5 => adcThru.gain;

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


Loading…
Cancel
Save