Code Snippets SuperCollider

Short texts SuperCollider 🧑‍💻 Code snippets SuperCollider ✍️ Reading lists SuperCollider 👀

buffer_extensions.sc

BufferSoundFileView : SoundFileView { var buffer; *new { |parent, bounds, buffer| ^super.new.init(parent, bounds, buffer); } init { |parent, bounds, buffer| buffer = buffer; buffer.getToFloatArray(timeout: 30, action: { |samples| { this.setData(samples); this.refresh; }.defer; }); } } Delegator { var wrapped; *new { |wrapped| ^super.newCopyArgs(wrapped); } respondsTo { |aSymbol| ^(super.respondsTo(aSymbol) || wrapped.respondsTo(aSymbol)); } doesNotUnderstand { |selector … […]

weightedWindow.scd

/* example of weighting window across the sphere */ /* note: after truncation rV < 1 for HOA1 */ // same order for decoding / re-encoding ~order = 1 ~order = 3 ~order = 5 ~hoaOrder = ~order.asHoaOrder // spherical design - minimum ~optimize = \spreadE ~tdesign = TDesign.newHoa(optimize: ~optimize, order: ~order) // order optimized […]

supercollider demo

// start scsynth, the server // s is bound to the default server when the sclang starts s.boot; // define a simple synthesizer definition and send it to the server SynthDef(‘simpleSine’, { Out.ar(0, SinOsc.ar(440, 0, -16.dbamp)); }).send(s); // create a synth using that definition a = Synth(‘simpleSine’); // destroy the synth a.free; SynthDef(‘fm’, { arg […]

An error has occured.

// I ran this which yielded the below error. ( Pdef(0, Pbind(*[ type: \cln, snd: \mmd, ]) ).play )