pink.node

Nodes aggregate audio from other audio-rate functions. Nodes can contain other nodes. Each Node is wrapped in pink.util.shared so that the output of Node may be used by multiple other audio-functions within the same time period.

In general, users will first call create-node to create a node map. node-processor will be used as the audio-rate function to add to an Engine, Node, or other audio-function.  

audio-node

(audio-node & {:keys [channels max-messages], :or {channels *nchnls*, max-messages 512}})
Creates a Node that also adheres to audio function convention (0-arity IFn that
returns audio buffer or nil).

control-node

(control-node & {:keys [channels max-messages], :or {channels *nchnls*, max-messages 512}})
Creates a Node that also adheres to control function convention (0-arity IFn that
returns true or nil).

control-node-processor

(control-node-processor node)
Creates a control node processing functions that runs controls functions, 
handling pending adds and removes, as well as filters out done functions.

create-node

(create-node & {:keys [channels max-messages], :or {channels *nchnls*, max-messages 512}})

fire-node-event

(fire-node-event node evt)
create an instance of an audio function and adds to the node

gain-node

(gain-node & {:keys [channels max-messages], :or {channels *nchnls*, max-messages 512}})
Creates an audio node that accepts stereo-signal audio functions. gain-node
sums the generated signals from the audio functions, multiplies by gain, and
outputs the stereo-signal output.

GainNode

protocol

members

get-gain

(get-gain n)
Get gain value.

set-gain!

(set-gain! n gain-val)
Set gain [0,1] to apply to signal

mixer-node

(mixer-node & {:keys [max-messages], :or {max-messages 512}})
Creates an audio node that accepts mono-signal audio functions. mixer-node
has properties for gain and panning which will be applied to all generated signals.
Output is a stereo signal.

Node

protocol

members

node-add-func

(node-add-func n func)
Add function to pending adds list

node-clear

(node-clear n)
Clear out all active and pending funcs

node-empty?

(node-empty? n)
Checks whether active and pending add lists are empty

node-remove-func

(node-remove-func n func)
Add func to pending removes list

node-state

(node-state n)
Returns state map for Node

node-events

(node-events node args)(node-events node x & args)
Takes a node and series of events, wrapping the events as node-events.
If single arg given, assumes it is a list of events.

node-processor

(node-processor node)
An audio-rate function that renders child funcs and returns the 
signals in an out-buffer.

run-afuncs!

(run-afuncs! afs buffer)

StereoMixerNode

protocol

members

get-pan

(get-pan n)
Get pan value.

set-pan!

(set-pan! n pan-val)
Set pan [-1,1] to apply to signal

wrap-node-event

(wrap-node-event node evt)