summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/SampOsc.ck26
-rw-r--r--lib/pulse.wavbin0 -> 35322 bytes
2 files changed, 26 insertions, 0 deletions
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/lib/pulse.wav b/lib/pulse.wav
new file mode 100644
index 0000000..ccf7b26
--- /dev/null
+++ b/lib/pulse.wav
Binary files differ