Skip to content

Instantly share code, notes, and snippets.

@xavriley
xavriley / wavetable_stuff.sc
Created November 13, 2017 08:20
SuperCollider wavetable experiments for Sonic Pi
s.boot
// BEGIN code to convert AKWF wavetables from 600 samples in length to 1024
// because VOsc3 needs a buffer which is a power of two to work properly
// this pipes in stdout from ls
(
var p, l;
p = Pipe.new("find ~/Projects/sonic-pi/etc/wavetables/AKWF/AKWF_0001 -iname *.wav", "r"); // list directory contents in long format
l = p.getLine; // get the first line
Pmonophonic : Pattern {
embedInStream {
|inEvent|
var id, offEvent;
var event = inEvent.copy;
var cleanup = EventStreamCleanup();
cleanup.addFunction(event, {
offEvent.play;
});