ProcMod:
Filter:
JoshMisc/Classes (extension) | Libraries > JoshUGens

ProcMod
ExtensionExtension

A real-time control structure

Description

A structure for controlling modular processes.

ProcMod will update the state of another object in a model-view-controller paradigm (see SimpleController). Currently implemented messages are \isRunning and \amp. See ProcEvents: Model-view-controller examples.

Class Methods

.initClass

.new

.play

Arguments:

env

An overall amplitude envelope that synths created in a ProcMod function can access. This will run a .kr env on ProcMod.envbus that can be read by other synths in the ProcMod through the creation of a procmodenv synth. There is a max of 20 breakpoints to the env. If the Env has a releaseNode, ProcMod will continue to process events until .release is called.

amp

An overall amplitude control for an instance of ProcMod.

id

A \symbol or "string" to be used later to identify an instance of ProcMod.

group

A group for an instance of ProcMod to run in. Defaults to nil and a new group is created. If ProcMod creates the group, a new one is created on each .play call.

addAction

An addAction for this instance of ProcMod. Defaults to 0.

target

A target for this instance of ProcMod. Defaults to 1.

function

A Function, Task or Routine to be evaluated on the playing of this instance of ProcMod. If a Function is passed in that returns a Task or Routine, the ProcMod will become 're-triggerable' and will allow for overlapping getures (it can be released and restarted immediately). All Functions, when evaluated, will have the current group id and envbus passed in as an argument.

releaseFunc

A Function, Task or Routine to be evaluated after the ProcMod has finished its release.

onReleaseFunc

A Function, Task or Routine to be evaluated at release time.

responder

An instance of OSCresponder or OSCresponderNode for use by this instance of ProcMod. It is automatically added when the ProcMod starts, and released after the ProcMod finishes its release.

timeScale

Applies a scale function to the ProcMod envelope. Defaults to 1.

lag

Applies to chages to the amp value passed into this instance of ProcMod.

clock

An intance of Clock to run this instance of ProcMod. Defaults to SystemClock.

server

an instance of Server to run this ProcMod on. Useful for remote servers. Defaults to Server.default.

.midiDevices

Instance Methods

.isRunning

.button

.window

.server

.envbus

Return the current control bus id the global envelope is written to for this instance of ProcMod.

.releasetime

.about

Arguments:

aboutString

.play

Avaluates this instance of ProcMod. ProcMod.function is evaluated, and ProcMod.responder is set up if they are declared.

.value

Same as .play.

Arguments:

recpath
timestamp
headerFormat
sampleFormat

.gui

Arguments:

bounds
upperLevel
lowerLevel
parent
trig
showMeters

.recordpath

.stopprocess

Arguments:

oldproc

.function

An instance of Function, Task or Routine to be evaluated on ProcMod.play. If a Function is passed in, the ProcMod will become 're-triggerable' and can be restarted after it has been released. If a Function is passed in, it may return a Task or Routine. The function is passed the ProcMod's current group and envbus as args.

.release

Aeleases an instance of ProcMod. If ProcMod.env has a release section, functions and OSCresponders wait until this has executed before releasing the ProcMods functionality.

Arguments:

reltime

.data

.responder

An instance of OSCresponder or OSCresponderNode for use by an instance of ProcMod.

Arguments:

aResponder

OSCresponder.

.timeScale

Arguments:

newtimeScale

.clock

.mapAmpToCC

Map MIDI continuous controller to the amplitude of this ProcMod. The messages are received from all MIDI sources.

NOTE: Be sure to run MIDIClient.init before calling this method.

Arguments:

control

CC number

maxamp

Maximum amplitude in dB (for MIDI value of 127)

minamp

Minimum amplitude in dB (for MIDI value of 0)

clientPort

If not nil, CC will be sent back to this port whenever amp_ is being updated. Useful for MIDI controllers that can update its state when receiving CC messages (e.g. having endless encoders with LED rings or motorized faders). The argument can be an instance of MIDIOut or MIDIEndPoint to specify a particular port reliably or an Integer specifying a device index in the MIDIClient.destination array. The messages are sent on the same channel to the same CC number as specified for receiving.

midiChannel

Channel to receive and send the messages on.

.releaseFunc

An instance of Function, Task or Routine to be evaluated after a ProcMod has released.

.info

.starttime

.addAction

Arguments:

newaddAction

.processPlay

.group

Return the current group of this instance of ProcMod.

.kill

Immediately free the ProcMod, regardless of ProcMod.env.

.clear

Arguments:

oldproc
oldresp
oldgroup
oldrelfunc
oldclock
oldhdr
oldroute
oldccctrl
oldenvbus

.id

.envnode

.now

.tempo

Arguments:

newTempo

.initProcMod

Arguments:

argClock
argServer
argEnv
argNumChannels
argProcout

.lag

If there is an envelope controlling the overall amplitude of events, set the lag time for changes of amplitude to take effect (with the amp_ instance method).

Arguments:

newlag

.env

An instance of Env to be sent to the synthdef controlling an instance of ProcMods overall amplitude and event control. If a Number is passed in, it will represent a releasetime for the ProcMod.

Arguments:

newenv

.process

.isReleasing

.target

Arguments:

newtarget

.onReleaseFunc

An instance of Function, Task or Routine to be evaluated the moment a ProcMod is released.

.pevents

.composite

.amp

If there is an envelope controlling the overall amplitude of events, set the amplitude to val.

Arguments:

newamp
sendMidi

.saveToData

places the Association into a Dictionary for later access. Any Association may be stored.

Arguments:

anAssociation

Examples

Re-triggerable ProcMods

ProcMods are meant for the most part, to be played and released. However, if the function slot is passed a Function object, they can be re-triggered after they have been released. If the Function returns a Task or Routine, the ProcMod will function as though a Task or Routine were placed in the function slot (it will be started and released in the same way). Re-triggered events will be assigned a new group and envbus, so these are made available to the Function through arguments. If an OSCresponderNode or releaseFunc are needed for each re-triggered event, they should be assigned inside the Function: