Skip to content

Instantly share code, notes, and snippets.

View scztt's full-sized avatar

scott carver scztt

  • Berlin
View GitHub Profile
(
~c = nil;
~c = ~c ?? { ControlValueEnvir(BusControlValue) }; // controls mapped to busses
~c.name = "My controls";
// ~c = ~c ?? { ControlValueEnvir(NumericControlValue) }; // controls mapped to sclang only values
// controls are automatically created when you refer to them, so you can just do ~controlName.spec = ....
// to set their spec. This determines what is displayed on the Electra screen.
Pmonophonic : Pattern {
*initClass {
Class.initClassTree(Event);
Event.composeEventType(
\monoUpdate,
composeType: \set,
parentEvent: (updateGroup:false),
func: {
|server, set|
var bundle;

Quark folder structure

NewQuark/
├── Assets
│   └── new_sound.wav
├── Classes
│   └── NewClass.sc
├── HelpSource
│   └── NewClass.scdoc
@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 = [];