Browse Source

Better metronome, better defaults, tidied, screenshot

master
Pete Shadbolt 10 years ago
parent
commit
2c6cff663e
3 changed files with 11 additions and 9 deletions
  1. +8
    -6
      main.ck
  2. +3
    -3
      main.py
  3. BIN
      screenshot.png

+ 8
- 6
main.ck View File

@@ -88,23 +88,25 @@ class LoopPedal
LiSa sample; LiSa sample;
sample => Gain wet; sample => Gain wet;
sample => Gain dry; sample => Gain dry;
dur loopTime;


// Setup // Setup
10::second => sample.duration; // Allocate max 10 secs of memory 10::second => sample.duration; // Allocate max 10 secs of memory
0::second => sample.recPos => sample.playPos; 0::second => sample.recPos => sample.playPos;
1.0 => sample.feedback; 1.0 => sample.feedback;
1 => sample.loop; 1 => sample.loop;
/*.5 => sample.rate;*/
setLoopPoint(1::second); setLoopPoint(1::second);
setWet(0.5); setWet(0.5);


public void setLoopPoint( dur length ) { length => sample.loopEnd => sample.loopEndRec; }
public void setLoopPoint( dur length ) { length => loopTime => sample.loopEnd => sample.loopEndRec; }
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 => panner.pan; } public void setPan( float pan ) { } //pan => panner.pan; }
public void setWet( float ratio ) { ratio => wet.gain; 1-ratio => dry.gain;} public void setWet( float ratio ) { ratio => wet.gain; 1-ratio => dry.gain;}
public void clear() { sample.clear(); } public void clear() { sample.clear(); }
public void recordFrom(UGen ugen) { ugen => sample; } public void recordFrom(UGen ugen) { ugen => sample; }
public dur remaining() { return sample.loopEnd() - sample.playPos(); }
public dur remaining() { return loopTime - sample.playPos(); }


public void outputTo(UGen wetSink, UGen drySink) { public void outputTo(UGen wetSink, UGen drySink) {
1 => sample.play; 1 => sample.play;
@@ -124,7 +126,7 @@ class Metronome
// A simple metronome // A simple metronome
SinOsc s => ADSR a; SinOsc s => ADSR a;
0.5 => s.gain; 0.5 => s.gain;
a.set(0.001, .1, .5, .05);
a.set(0.001, .1, .5, .13);
10::ms => dur plipTime; 10::ms => dur plipTime;


fun void mute(int value) { fun void mute(int value) {
@@ -134,13 +136,13 @@ class Metronome
fun void run() { fun void run() {
while(true) { while(true) {
// Compute the beat time // Compute the beat time
pedals[0].sample.loopEnd()/4. - plipTime => dur beatTime;
pedals[0].loopTime/4. - plipTime => dur beatTime;


// Beep four times // Beep four times
1000 => s.freq;
50 => s.freq;
a.keyOn(); plipTime => now; a.keyOff(); a.keyOn(); plipTime => now; a.keyOff();
beatTime => now; beatTime => now;
500 => s.freq;
50 => s.freq;
a.keyOn(); plipTime => now; a.keyOff(); a.keyOn(); plipTime => now; a.keyOff();
beatTime => now; beatTime => now;
a.keyOn(); plipTime => now; a.keyOff(); a.keyOn(); plipTime => now; a.keyOff();


+ 3
- 3
main.py View File

@@ -259,15 +259,15 @@ class FXPanel(wx.Panel):
label.SetFont(font) label.SetFont(font)
sizer.Add(label, 0, wx.EXPAND | wx.TOP | wx.BOTTOM | wx.RIGHT, 5) sizer.Add(label, 0, wx.EXPAND | wx.TOP | wx.BOTTOM | wx.RIGHT, 5)


self.lpf = OSCSlider(self, "Lo-pass", default_value=.9, align=False)
self.lpf = OSCSlider(self, "Lo-pass", default_value=1, align=False)
sizer.Add(self.lpf, 2, wx.EXPAND | wx.ALL, 5) 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=.1, align=False)
self.hpf = OSCSlider(self, "Hi-pass", min_value=0, default_value=0, align=False)
sizer.Add(self.hpf, 2, wx.EXPAND | wx.ALL, 5) sizer.Add(self.hpf, 2, wx.EXPAND | wx.ALL, 5)
self.hpf.Bind(wx.EVT_SCROLL, self.update) self.hpf.Bind(wx.EVT_SCROLL, self.update)


self.reverb = OSCSlider(self, "Reverb", default_value=.5, align=False)
self.reverb = OSCSlider(self, "Reverb", default_value=.1, align=False)
sizer.Add(self.reverb, 2, wx.EXPAND | wx.ALL, 5) sizer.Add(self.reverb, 2, wx.EXPAND | wx.ALL, 5)
self.reverb.Bind(wx.EVT_SCROLL, self.update) self.reverb.Bind(wx.EVT_SCROLL, self.update)




BIN
screenshot.png View File

Before After
Width: 390  |  Height: 403  |  Size: 25KB Width: 530  |  Height: 425  |  Size: 32KB

Loading…
Cancel
Save