This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PparStream : Stream { | |
var <>initStreamAction, <>endStreamAction; | |
var priorityQ, <now; | |
var <injectFunc; | |
*initClass { | |
Class.initClassTree(Event); | |
Event.addEventType(\fork, { | |
var event, outerEvent, recursionLevel, instrument, embeddingLevel, freq, rest; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Reset `pattern` every `durs` beats. | |
// If pattern is finished, yield `emptyValue` until we are reset. | |
// ( | |
// Pdef(\ptclip, Pbind( | |
// \scale, Scale.bartok, | |
// \dur, 1/8, \legato, 3, | |
// \octave, 4, | |
// \degree, PTclip( | |
// Prand([0, 1, 3, 6, 8], inf), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+SynthDef { | |
addReplace { | |
arg libname, completionMsg, keepDef = true; | |
var servers; | |
this.add(libname, completionMsg, keepDef); | |
if(libname.isNil) { | |
servers = Server.allRunningServers | |
} { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Quarks.install("https://github.com/scztt/OSequence.quark"); | |
// Quarks.install("https://github.com/scztt/Require.quark"); | |
~loaded = Require("LOADER").("HKW-3/*"); | |
~loaded.postEvents; | |
~loaded.seq.do(_.postln); | |
~eventStream = ~loaded.seq.asStream; | |
// An array of all \degree values | |
~justDegrees = ~loaded.seq.collect(_[\degree]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( | |
SynthDef(\player, { | |
var sig; | |
sig = PlayBuf.ar(2, \bufnum.kr(0), startPos: 120 * 44100, doneAction:2); | |
Out.ar(0, sig) | |
}).add.store; | |
Pdef(\player).clear; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( | |
SynthDef.channelized(\loop, { | |
|numChannels| | |
var sig, loopDur, loopStart, loopTrim, buffer, phase, samples; | |
var rate, loopSamples; | |
buffer = \buffer.kr; | |
loopDur = \loopDur.kr(1); | |
loopStart = \loopStart.kr(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Subdivision : Operand { | |
var <>scale, <>offset, <>isRest, <>grid; | |
*new { | |
|value, scale=1, offset=0, grid=nil, isRest=false| | |
^(super.new(value) | |
.scale_(scale) | |
.offset_(offset) | |
.grid_(grid) | |
.isRest_(isRest)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Play many patterns according to their own delta's', composing the events from bottom to top. | |
// Deltas of first pattern are responsible for timing of output events | |
// | |
// ( | |
// Pdef(\ptchain).clear; | |
// Pdef(\ptchain, PTChain( | |
// Pbind( | |
// \dur, Pseg([1/32, 1/2, 1/32], [16, 16], \exponential, inf), | |
// \velocity, Pwhite(40, 127), | |
// \strum, Pkey(\dur) / 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
Event.addEventType(\pattern, { | |
var pat, event, outerEvent, recursionLevel, instrument, embeddingLevel, freq, rest; | |
var args, defaults, timingOffset; | |
~pattern = ~pattern ?? { ~instrument }; | |
if (~pattern.isKindOf(Function)) { | |
defaults = ~pattern.def.prototypeFrame; | |
args = ~pattern.def.argNames.collect { |