Event types Different ways that an Event can "play"


Note: this helpfile is incomplete.


An Event responds to a play message by evaluating ~play in the event, and the default behaviour of ~play is determined by the value of ~type. Commonly-used event types include:


\note - used to instantiate a synth on the server, with specified arguments, and later to free it. The choice of SynthDef is specified using the \instrument key. This event type is commonly implicit in much Pattern usage. 

\set - used to set parameters of some already-running node(s). (See also: note in Pmono helpfile)


A more complete list of event types is given further down this document. To see how event types are normally invoked, here is a slightly simplified version of the default definition of  ~play as defined in the Event class:


{ ~eventTypes[~type].value(server); },


The function uses the value of ~type to select a function from the Dictionary held in ~eventTypes. The collection of eventTypes can be readily extended using *addEventType(key, function).  


Here is an example the uses the event types  \group and \note:


(type: \group, id: 2).play // create a group with nodeID 2

(type: \note, freq: 500, group: 2).play // play a synth in that group



Here is a listing of currently existing event types:


 group creates group, ~id must be specified

 note ~instrument specifies synthdef

 note_score

 midi

 

 monoNote used by Pmono

 monoSet used by Pmono

 monoOff

 

 on play synth, ~id must be specified

 off release synth (or free if no gate)

 kill free synth

 set set parameter of synth

 

 rest do nothing

 

 

 bus write ~array to control buses starting at ~out

 

 alloc allocate ~bufnum with ~numframes and ~numchannels

 free free ~bufnum

 gen     send ~gencmd to ~bufnum

 load load ~filename starting at ~frame into ~bufnum

 read

 

 setProperties  ~receiver, ~args 

  sends setter messages to ~receiver for each key in ~args that has a nonNil value in the Event.

 tree creates a tree of groups. ~tree can be an array of nodeIDs, and may contain associations to further nested arrays.

 

 phrase instead of playing a single synth from a SynthDef with ~instrument, it looks up a Pdef and plays a cluster of sounds.