diff options
-rw-r--r-- | lib.ck | 1 | ||||
-rw-r--r-- | lib/SampOsc.ck | 26 | ||||
-rw-r--r-- | lib/pulse.wav (renamed from pulse.wav) | bin | 35322 -> 35322 bytes |
3 files changed, 27 insertions, 0 deletions
@@ -1,4 +1,5 @@ /* Includes */ +Machine.add("lib/SampOsc.ck"); Machine.add("lib/Clipper.ck"); Machine.add("lib/MIDI.ck"); Machine.add("lib/Queue.ck"); diff --git a/lib/SampOsc.ck b/lib/SampOsc.ck new file mode 100644 index 0000000..bc5feda --- /dev/null +++ b/lib/SampOsc.ck @@ -0,0 +1,26 @@ +/* + * Sample based oscillator + * NOTE: may not be frequency-synced! + */ +public class SampOsc extends SndBuf { + 1 => float __freq; /* pseudo-private */ + fun float freq(float f) + { + return f => __freq; + } + fun float freq() + { + return __freq; + } + + /* FIXME: not independant from cwd when instantiated */ + "lib/pulse.wav" => read; + 1 => rate; + + fun void __loop() /* pseudo-private */ + { + while (second/__freq => now) + 0 => pos; + } + spork ~ __loop(); +} diff --git a/pulse.wav b/lib/pulse.wav Binary files differindex ccf7b26..ccf7b26 100644 --- a/pulse.wav +++ b/lib/pulse.wav |