Browse Source

Better metronome, better defaults, tidied, screenshot

Pete Shadbolt 4 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
88 88
     LiSa sample;
89 89
     sample => Gain wet;
90 90
     sample => Gain dry;
91
+    dur loopTime;
91 92
 
92 93
     // Setup
93 94
     10::second => sample.duration;  // Allocate max 10 secs of memory
94 95
     0::second => sample.recPos => sample.playPos;
95 96
     1.0 => sample.feedback;
96 97
     1 => sample.loop;
98
+    /*.5 => sample.rate;*/
97 99
     setLoopPoint(1::second);
98 100
     setWet(0.5);
99 101
 
100
-    public void setLoopPoint( dur length ) { length => sample.loopEnd => sample.loopEndRec; }
102
+    public void setLoopPoint( dur length ) { length => loopTime => sample.loopEnd => sample.loopEndRec; }
101 103
     public void setFeedback( float fb ) { fb => sample.feedback; }
102 104
     public void setGain( float gain ) { gain => sample.gain; }
103 105
     public void setPan( float pan ) { } //pan => panner.pan; }
104 106
     public void setWet( float ratio ) { ratio => wet.gain; 1-ratio => dry.gain;} 
105 107
     public void clear() { sample.clear(); }
106 108
     public void recordFrom(UGen ugen) { ugen => sample; }
107
-    public dur remaining() { return sample.loopEnd() - sample.playPos(); }
109
+    public dur remaining() { return loopTime - sample.playPos(); }
108 110
 
109 111
     public void outputTo(UGen wetSink, UGen drySink) { 
110 112
         1 => sample.play; 
@@ -124,7 +126,7 @@ class Metronome
124 126
     // A simple metronome
125 127
     SinOsc s => ADSR a;
126 128
     0.5 => s.gain;
127
-    a.set(0.001, .1, .5, .05);
129
+    a.set(0.001, .1, .5, .13);
128 130
     10::ms => dur plipTime;
129 131
 
130 132
     fun void mute(int value) {
@@ -134,13 +136,13 @@ class Metronome
134 136
     fun void run() {
135 137
             while(true) {
136 138
                 // Compute the beat time
137
-                pedals[0].sample.loopEnd()/4. - plipTime => dur beatTime;
139
+                pedals[0].loopTime/4. - plipTime => dur beatTime;
138 140
 
139 141
                 // Beep four times
140
-                1000 => s.freq;
142
+                50 => s.freq;
141 143
                 a.keyOn(); plipTime => now; a.keyOff();
142 144
                 beatTime => now;
143
-                500 => s.freq;
145
+                50 => s.freq;
144 146
                 a.keyOn(); plipTime => now; a.keyOff();
145 147
                 beatTime => now;
146 148
                 a.keyOn(); plipTime => now; a.keyOff();

+ 3
- 3
main.py View File

@@ -259,15 +259,15 @@ class FXPanel(wx.Panel):
259 259
         label.SetFont(font)
260 260
         sizer.Add(label, 0, wx.EXPAND | wx.TOP | wx.BOTTOM | wx.RIGHT, 5)
261 261
 
262
-        self.lpf = OSCSlider(self, "Lo-pass", default_value=.9, align=False)
262
+        self.lpf = OSCSlider(self, "Lo-pass", default_value=1, align=False)
263 263
         sizer.Add(self.lpf, 2, wx.EXPAND | wx.ALL, 5)
264 264
         self.lpf.Bind(wx.EVT_SCROLL, self.update)
265 265
 
266
-        self.hpf = OSCSlider(self, "Hi-pass", min_value=0, default_value=.1, align=False)
266
+        self.hpf = OSCSlider(self, "Hi-pass", min_value=0, default_value=0, align=False)
267 267
         sizer.Add(self.hpf, 2, wx.EXPAND | wx.ALL, 5)
268 268
         self.hpf.Bind(wx.EVT_SCROLL, self.update)
269 269
 
270
-        self.reverb = OSCSlider(self, "Reverb", default_value=.5, align=False)
270
+        self.reverb = OSCSlider(self, "Reverb", default_value=.1, align=False)
271 271
         sizer.Add(self.reverb, 2, wx.EXPAND | wx.ALL, 5)
272 272
         self.reverb.Bind(wx.EVT_SCROLL, self.update)
273 273
 

BIN
screenshot.png View File