소스 검색

Better metronome, better defaults, tidied, screenshot

master
Pete Shadbolt 10 년 전
부모
커밋
2c6cff663e
3개의 변경된 파일11개의 추가작업 그리고 9개의 파일을 삭제
  1. +8
    -6
      main.ck
  2. +3
    -3
      main.py
  3. BIN
      screenshot.png

+ 8
- 6
main.ck 파일 보기

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

// Setup
10::second => sample.duration; // Allocate max 10 secs of memory
0::second => sample.recPos => sample.playPos;
1.0 => sample.feedback;
1 => sample.loop;
/*.5 => sample.rate;*/
setLoopPoint(1::second);
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 setGain( float gain ) { gain => sample.gain; }
public void setPan( float pan ) { } //pan => panner.pan; }
public void setWet( float ratio ) { ratio => wet.gain; 1-ratio => dry.gain;}
public void clear() { sample.clear(); }
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) {
1 => sample.play;
@@ -124,7 +126,7 @@ class Metronome
// A simple metronome
SinOsc s => ADSR a;
0.5 => s.gain;
a.set(0.001, .1, .5, .05);
a.set(0.001, .1, .5, .13);
10::ms => dur plipTime;

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

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


+ 3
- 3
main.py 파일 보기

@@ -259,15 +259,15 @@ class FXPanel(wx.Panel):
label.SetFont(font)
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)
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)
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)
self.reverb.Bind(wx.EVT_SCROLL, self.update)



BIN
screenshot.png 파일 보기

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

불러오는 중...
취소
저장