Browse Source

Added reverse, half, double speed. Currently they de-sync the loop

master
Pete Shadbolt 9 years ago
parent
commit
1daf7a8d33
2 changed files with 11 additions and 5 deletions
  1. +7
    -1
      main.ck
  2. +4
    -4
      main.py

+ 7
- 1
main.ck View File

@@ -65,6 +65,10 @@ while (true) {
msg.getInt(0) => int i; msg.getInt(0) => int i;
pedals[i].setLoopPoint(globalLoopTime * msg.getFloat(1)); pedals[i].setLoopPoint(globalLoopTime * msg.getFloat(1));
} }
else if(msg.address=="/direction"){
msg.getInt(0) => int i;
pedals[i].setDirection(msg.getFloat(1));
}
else if(msg.address=="/arm") { else if(msg.address=="/arm") {
msg.getInt(0) => int channel; msg.getInt(0) => int channel;
(channel<0) => adcThruMute; (channel<0) => adcThruMute;
@@ -111,6 +115,9 @@ class LoopPedal
public void setLoopPoint( dur length ) { public void setLoopPoint( dur length ) {
length => loopTime => sample.loopEnd => sample.loopEndRec; length => loopTime => sample.loopEnd => sample.loopEndRec;
} }
public void setDirection( float direction ) {
direction => sample.rate;
}
public void setFeedback( float fb ) { fb => sample.feedback; } public void setFeedback( float fb ) { fb => sample.feedback; }
public void setGain( float gain ) { gain => sample.gain; } public void setGain( float gain ) { gain => sample.gain; }
public void setPan( float pan ) { pan => dry.pan; } public void setPan( float pan ) { pan => dry.pan; }
@@ -139,7 +146,6 @@ class Metronome
// A simple metronome // A simple metronome
SinOsc s => ADSR a; SinOsc s => ADSR a;
60 => s.freq; 60 => s.freq;
0.5 => s.gain;
0.6 => s.gain; 0.6 => s.gain;
a.set(0.001, .1, .5, .13); a.set(0.001, .1, .5, .13);
10::ms => dur plipTime; 10::ms => dur plipTime;


+ 4
- 4
main.py View File

@@ -188,7 +188,7 @@ class Channel(wx.Panel):
self.speed.SetValue(choices[0]) self.speed.SetValue(choices[0])
sizer.Add(self.speed, 0, wx.ALL | wx.EXPAND, 3) sizer.Add(self.speed, 0, wx.ALL | wx.EXPAND, 3)


choices = ["Live →", "Live ←", "Live ↔", "Half speed"]
choices = ["Forward", "Back", "Half", "Double"]
self.direction = wx.ComboBox(self, choices=choices, style=wx.CB_READONLY, size=(25, 25)) self.direction = wx.ComboBox(self, choices=choices, style=wx.CB_READONLY, size=(25, 25))
self.direction.SetValue(choices[0]) self.direction.SetValue(choices[0])
sizer.Add(self.direction, 0, wx.ALL | wx.EXPAND, 3) sizer.Add(self.direction, 0, wx.ALL | wx.EXPAND, 3)
@@ -199,7 +199,7 @@ class Channel(wx.Panel):
self.pan.Bind(wx.EVT_SCROLL, self.update) self.pan.Bind(wx.EVT_SCROLL, self.update)
self.fxsend.Bind(wx.EVT_SCROLL, self.update) self.fxsend.Bind(wx.EVT_SCROLL, self.update)
self.speed.Bind(wx.EVT_COMBOBOX, self.update_multiplier) self.speed.Bind(wx.EVT_COMBOBOX, self.update_multiplier)
self.direction.Bind(wx.EVT_TOGGLEBUTTON, self.update_direction)
self.direction.Bind(wx.EVT_COMBOBOX, self.update_direction)
self.mute.Bind(wx.EVT_TOGGLEBUTTON, self.update) self.mute.Bind(wx.EVT_TOGGLEBUTTON, self.update)
self.update() self.update()


@@ -217,9 +217,9 @@ class Channel(wx.Panel):


def update_direction(self, evt=None): def update_direction(self, evt=None):
#multiplierTable = {"1 bar": 1., "2 bars": 2., "4 bars": 4., "Dephase": 1.3} #multiplierTable = {"1 bar": 1., "2 bars": 2., "4 bars": 4., "Dephase": 1.3}
directionTable = {"Live →":0, "Live ←"1, "Live ↔"2, "Half speed"3}
directionTable = {"Forward":1., "Back":-1., "Half":.5, "Double":2.}


direction = directionTable[self.speed.GetValue()]
direction = directionTable[self.direction.GetValue()]
sendOSCSafe("/direction", [self.index, direction]) sendOSCSafe("/direction", [self.index, direction])






Loading…
Cancel
Save