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

ProcEvents
ExtensionExtension

A real-time control structure

Description

A structure for controlling modular processes.

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

Class Methods

.buildFromFile

Arguments:

procdict
tolerance
... paths

.initClass

.new

Arguments:

events

An array of events (ProcMods or a function) to play / release in the following format: [ProcMod, ProcMod.id to release]. Both the events to play and release may also be arrays, or nil. If the event is a function, realize that it is best to be a single shot type of thing, you won't be able to access it later (to stop a loop, for instance). So, make sure it is something that you set to run or execute, then can forget about completely.

amp

An amplitude scaler for everything running in the ProcEvents instance.

initmod

A ProcMod to be evaluated when the first event is called, regardless of event number. Useful for allocating buffers or persistant synths.

killmod

A ProcMod to be evaluated when this instance of ProcEvents is killed. Useful for freeing buffers and killing persistant synths.

id

A \symbol or "string" to identify this instance of ProcEvents server - an instance of Server to run this ProcMod on. Useful for remote servers. Defaults to Server.default.

server
lag

Instance Methods

.reset

Releases all running ProcMods and resets the system to evaluate initmod again.

.pracwindow

.pedalin

.eventDict

.releaseAll

Releases all running ProcMods EXCEPT the initmod.

Arguments:

rel

.now

Returns the current time in reference to the starttime of 'id'. 'id' should be a \symbol or "string". If 'id' is nil, the reference will be the ProcEvents starttime itself.

Arguments:

id

.recordTimeLine

.pracGUI

Creates a GUI with basic ProcMod controls and a perfGUI for rehearsal purposes.

.timeArray

.stamp

Arguments:

idx

.eventArray

.preKill

.next

Will play and release the next event in the events array. Starts at 0. If initmod has not been executed, it will be.

.scope

.timeLine

Arguments:

timeLineArray

.clock

.procampsynth

.pedal

.timeStamp

.stopRecord

.index

The next event's index. This is used internally and only when there's no GUI.

Arguments:

nextIdx

.indexPlaying

Returns an Integer of the currently playing index. Will be nil initially and after resetting.

.bigNum

.currentTime

.saveTimeLine

Arguments:

path

.server

.triglevel

.id

.buttonWidth

.playTimeLine

Arguments:

wait

.amp

Arguments:

newamp
newlag

.recordPM

.isPlaying

.stopRecordTimeLine

.initProcEvents

Arguments:

events
argamp
arginitmod
argkillmod
argid
argserver
arglag

.pedalnode

.timeOffset

.releaseButton

.pedalTrig

listens to pedalbus for Amplitude triggers. This is fairly specialized. I use a quater inch keyboard sustain pedal (a ground switch). When pedalTrig is invoked, an OSCresponderNode is started that listens for a noise floor for testdur seconds. An average reading is taken and is stored as a basevalue. When the pedal is pressed, a spike in amplitude is created. If the spike is within basevalue * headroom, the next event is called. Some tuning should be done to find a headroom value that will work reliably. Triggers are limited to one trigger in every trigwindow seconds.

NOTE: The server MUST be booted before .pedalTrig is called.

TO DO: create a way to store values from the pracGUI to be re-used for later performances.

Arguments:

pedalbus
trigwindow
testdur
guiBounds
addAction
target

.killAll

Kill this instance of ProcEvents. Frees everything.

.pracmode

.stopTimeLine

.headerFormat

.sampleFormat

.pedrespsetup

.pedalgui

.eventButton

.withTimeLine

Arguments:

timeLineArray
timeLineStart

.play

Plays and releases the events at index in the events array. If initmod has not been executed, it will be.

Arguments:

event

.showPMGUIs

.onEvent

.ampDict

.perfGUI

Creates a GUI with basic ProcEvents controls to perform an instance of ProcEvents.

Arguments:

guiBounds
buttonColor
parent

.loadTimeLine

Arguments:

path

.releaseArray

.lag

Arguments:

newlag

.record

Arguments:

path
argTimeStamp
argHeaderFormat
argSampleFormat

.bigNumGUI

Arguments:

bigNumBounds
fontSize

.window

.starttime

Returns the starttime of the ProcMod with 'id' in relation to the starttime of ProcEvents' first event. Id should be a \symbol or "string". If 'id' is nil, the time of the first event of this instance of ProcEvents (according to Main.elapsedTime) is returned.

Arguments:

newtime

.killButton

.pedresp

.buttonHeight

Examples

Model-view-controller examples