View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide

using Instr as templates for SynthDefs that can be used in Patterns

Home   How To   Code Pool   Public Library   Theory   Events
The Instr class that is part of crucial library can be used to generate
SynthDefs by combining modular parts.

Here is a class that makes this easier and more expressive. [jrh]


////// this doesn't work reliably yet //////

it can be used like this:


Instr(\sine, { arg freq=440, amp=0.1; * amp });
Instr(\panner, { arg input, pan=0;, pan) });

PatchSynthDef("test", [\panner, [\sine, 700], 0]).store;

x = Synth("test");
x.set(\out, 4);
x.set(\out, 0);

PatchSynthDef("test", { arg freq=800;	
	[\panner, [\sine, freq * [1, 1.2], 0.1], 0]

x = Synth("test");
x.set(\freq, 500);

	\instrument, \test,
	\degree, Prand([0, 3, 5], inf),
	\dur, 0.3

Link to this Page