Skip to content

Instantly share code, notes, and snippets.

View scztt's full-sized avatar

scott carver scztt

  • Berlin
View GitHub Profile
DummyMIDI {
var dummy = 0;
*new {
^super.newCopyArgs();
}
noteOn {}
noteOff {}
control {}
@scztt
scztt / extFile.sc
Last active January 23, 2026 13:02
// XMP parsing requires:
// Quarks.install("XML"); [in supercollider]
// brew install exiftool [in terminal]
+SoundFile {
exiftoolPath {
^"/usr/local/bin/exiftool"
}
extractMarkers {
double cfunc(int a, int b, float c, double d)
{
return d + c + b + a;
}
template <typename ValueT>
void SetSlotVal(PyrSlot* slot, const ValueT& val);
template<> void SetSlotVal<double>(PyrSlot* slot, const double& val) { SetFloat(slot, val); }
template<> void SetSlotVal<float>(PyrSlot* slot, const float& val) { SetFloat(slot, val); }
Deferred {
var value, error, resolved=\unresolved, waitingThreads;
*new {
^super.new.init
}
*using {
|func, clock|
var d = Deferred();
// Deferred
(
// Value is not available yet, so error
d = Deferred();
d.value.postln;
)
(
// Value is available
@scztt
scztt / debugScope.sc
Last active February 29, 2024 12:26
+ Bus {
debugScope {
| title, names |
var w, ms, listArray, size=380, sliderLoc=0, routine, bus,
min=1000.0, max=(-1000.0), minBox, maxBox, val=0, valBox, synth, m, n, bottom,
playSynthFunction, cmdPeriodFunction, layout;
cmdPeriodFunction = {};
title = title ? "bus %".format( index );
+SynthDef {
// buildForProxy {}
numChannels {
^(desc !? (_.numChannels))
}
rate {
^(desc !? (_.rate));
}
@scztt
scztt / PtimeClutch.sc
Created July 9, 2019 19:43
PtimeClutch
// Only pull a value once per clock time - else, return the previous value
PtimeClutch : FilterPattern {
var <>delta;
*new {
|pattern, delta=0.0|
^super.new(pattern).delta_(delta);
}
embedInStream {
+Object {
assertChannels {
|...args|
if (this.asArray.shape != args) {
Exception("Expected array of shape % (array is %)".format(args, this.shape)).throw;
}
}
}
@scztt
scztt / Pmod.sc
Last active November 5, 2019 21:33
Pmod : Pattern {
classvar defCache;
var <>synthName, <>patternPairs, <rate=\control, <>channels=1;
*new {
|synthName ... pairs|
^super.newCopyArgs(synthName, pairs)
}
*kr {