SuperCollider CLASSES (extension)

ModMap

A tool for modulating Ndefs
Inherits from: Radicles : Object

Description

A tool for modulating Ndefs with predetermined ControlFiles and Specs.

Class Methods

*new

From superclass: Radicles

Create a new ModMap to modulate Ndefs.

Arguments:

(arg1)

Fade time for ModMap.

Inherited class methods

Undocumented class methods

*clearLooseMods (action)

*getFile (type: 'sin', spec, extraArgs, func)

*getPresets

*lag (modNum: 1, key, value)

*lagArr

*list

*map (ndef, key: 'freq', type: 'sin', spec, extraArgs, func, mul: 1, add: 0, min, val, warp, lag)

*modInfoArr

*modNodes

*ndefs

*presetToCode (arr, newNdef)

*read (type)

*set (modNum: 1, key, value)

*unmap (ndef, key, value)

*unmapAt (index)

*xset (modNum: 1, key, value)

Instance Methods

-map: METHOD NOT FOUND!

Arguments:

Input Ndef

key for argument to be modulated

key for type of modulation from ControlFiles

spec array

extraArguments for modulating signal (for example to control modulation frequency)

lag time

where to post?

Inherited instance methods

Examples

s.boot;

Ndef(\play1, {arg freq=300; SinOsc.ar(freq, 0, 0.2) }).play;
ModMap.map(Ndef(\play1), \freq, \sin, \freq1, [\freq, 1]);
ModMap.lag(1, \freq, 5);
ModMap.set(1, \freq, 10);
ModMap.set(1, \freq, 0.1);
ModMap.unmap(Ndef(\play1), \freq);

//same if you don't want to keep track
a = ModMap.map(Ndef(\play1), \freq, \sin, \freq1, [\freq, 1]);

a.lag(\freq, 10);
a.set(\freq, rrand(1,10.0).postln)
a.set(\freq, 0.1);
a.set(\freq, 10);

Ndef(\play2, {arg freq=300; Saw.ar(freq, 0.2) }).play;
ModMap.map(Ndef(\play2), \freq, \sin, \freq1, [\freq, 1]);
ModMap.ndefs;
ModMap.lag(1, \freq, 1);
ModMap.set(1, \freq, rrand(1,10.0).postln);

ModMap.unmap(Ndef(\play1), \freq);

ModMap.map(Ndef(\play1), \freq, \sin, \freq1, [\freq, rrand(1,10.0).postln]);

ModMap.unmap(Ndef(\play2), \freq, 1000);

ModMap.unmapAt(0);

SpecFile.all
SpecFile.postAll(\space)

Ndef(\play3, {arg freq=300, pan=0; Pan2.ar(SinOsc.ar(freq, 0, 0.2), pan) }).play;
ModMap.map(Ndef(\play3), \pan, \sin, [\space, \pan], [\freq, 1]);

ModMap.map(Ndef(\play3), \freq, ControlFile.read(\map).choose.postln, \freq1, [\freq, 1]); //try different times for different mapings

ModMap.map(Ndef(\play3), \freq, \sin, \freq1, [\freq, 1], mul: [0.25,0.5,1,2].choose.postln); //notice mul factors to change spec min and max values

ModMap.map(Ndef(\play3), \freq, \sin, \freq1, [\freq, 1], mul: 0.1, add: -12); //change mul and add factors

Ndef.clear(5);

ControlSpec

efSet 1 1 -> sin(0.2) //mul
prt -> lfn1(0.2,100,\lin) //mul, add, warp
prt -> lfn1[400,440,\exp] //minval, maxval, warp
efSet 1 1 500