Instr SynthDefs:
Filter:
crucial-library/Guides (extension) | Libraries > crucial > Instr

Instr SynthDefs
ExtensionExtension

How Instr make SynthDefs

An Instr is not a SynthDef

An Instr is a function that creates SynthDefs.

Each argument in the function for a SynthDef creates a Control input to the Synth that will eventually play on the server.

An Instr can also include extra arguments that will be used in building the SynthDef, but will not be Control inputs on the final synth.

For instance an Integer may be passed in:

The first input to the synth is a stereo audio rate input, the others were fixed floats that did not require synth inputs.

Envelopes, fixed floats, fixed integers, Samples etc. can be passed into Instr functions.

When Patch is used to specify the inputs to the function some of these inputs will be reduced to fixed values (integers, floats, Envelopes etc.), and the resulting SynthDef will contain those inputs hard-coded. Using different Patches, it is possible to write many SynthDefs from the same Instr.

If the input supplied is stereo, the synthDef produced will be stereo.

It is possible to play another Instr inside of your Instr:

and thus get further reuse out of your library of functions. Here the \rlpf that is used inside doesn't produce a synth def, but is used as a simple function in the ugenGraph of the \sawfilter Instr which does make a synthDef.

Dynamic SynthDef architecture

You can design Instr to take parameters that are used only in the building of the SynthDef. This can be used to select from different kinds of filters or to build a mini-modular synth.

The upDown param acts as a switch between different synth def architectures. If your Instr library is well designed you can acheive very sophisticated sound structures with automatic optimizations and code reuse.

Note that the Patch would assume upDown to be a modulatable control input (with a default of 0.0) without the StaticIntegerSpec making it clear that its a static integer.

see also Patch-client-server-magic