Skip to content

Instantly share code, notes, and snippets.

View scztt's full-sized avatar

scott carver scztt

  • Berlin
View GitHub Profile
@scztt
scztt / Gdef.sc
Last active January 28, 2025 13:21
Gdef : Singleton {
classvar <groupOrder, rebuildBundle, <nodeMap;
var <group, <afterList, <beforeList, <server, <>permanent=true;
classvar blockUpdate=false, updateCount=0;
*initClass {
[Event, EventTypesWithCleanup].do(Class.initClassTree(_));
groupOrder = LinkedList();
nodeMap = IdentityDictionary();
@scztt
scztt / String-unicode.sc
Last active December 12, 2024 15:15
unicode Strings
+String {
unicodeSize {
var size = this.size;
size = size - (this.select({ |c| c.ascii < 0 }).size / 3 * 2).asInteger;
^size;
}
unicodeIndex {
|index|
var i = 0;
(
Ndef(\synth, {
var lpf, res, distort, rate, decay,
freq, amp, sig, env, trig, detune;
// CONTROLS
lpf = \lpf.ar(540);
res = \res.ar(0.9);
distort = \distort.ar(0.7);
(
var guiFunc;
var ampMin = -70;
var ampMax = 36;
var numberBoxHeight = 22;
var oscDef;
var compressFunc = {
|isSynth, amp, aboveRatio, belowRatio, ratioScale, aboveThreshold, belowThreshold, knee, curve, expandMax, plot=false|
+UGen {
fadeChange {
|func, fadeTime=1, fadeClass=(XFade2)|
^[this].fadeChange(func, fadeTime, fadeClass)
}
fadeTrig {
|func, fadeTime=1, fadeClass=(XFade2)|
^[this].fadeTrig(func, fadeTime, fadeClass)
}
fadeSteps {
Pmonophonic : Pattern {
embedInStream {
|inEvent|
var id, offEvent;
var event = inEvent.copy;
var cleanup = EventStreamCleanup();
cleanup.addFunction(event, {
offEvent.play;
});
PparStream : Stream {
var <>initStreamAction, <>endStreamAction;
var priorityQ, <now;
var <injectFunc, pausedStreams;
*forkPatterns {
|pattern|
var event, outerEvent, recursionLevel, instrument, embeddingLevel, freq, rest;
var args, defaults, timingOffset, sustain, gatePattern;
var size, newPatterns = [];
@scztt
scztt / Gdef.sc
Created December 19, 2023 21:41
Gdef : Singleton {
classvar <groupOrder, rebuildBundle, <nodeMap;
var <group, <afterList, <beforeList, <server, <>permanent=true;
classvar blockUpdate=false, updateCount=0;
*initClass {
[Event, EventTypesWithCleanup].do(Class.initClassTree(_));
groupOrder = LinkedList();
nodeMap = IdentityDictionary();
// XMP parsing requires:
// Quarks.install("XML"); [in supercollider]
// brew install exiftool [in terminal]
+SoundFile {
exiftoolPath {
^"/usr/local/bin/exiftool"
}
extractMarkers {
+Object {
|> {
|other|
^other.value(this)
}
+> {
|other, adverb|
^(this +.(adverb) other.value(this))
}