hsc3-0.17: Haskell SuperCollider

Safe HaskellSafe
LanguageHaskell98

Sound.SC3.UGen.Graph.Transform

Contents

Description

Transformations over Graph structure.

Synopsis

Lift constants

constant_to_control :: UID_t -> U_Node -> (UID_t, U_Node) Source #

Transform U_Node_C to U_Node_K, id for other U_Node types.

let k = U_Node_K 8 KR Nothing "k_8" 0.1 K_KR Nothing
node_k_eq k (snd (constant_to_control 8 (U_Node_C 0 0.1)))

c_lift_from_port :: U_Graph -> UID_t -> From_Port -> (UID_t, Either From_Port U_Node) Source #

If the From_Port is a constant generate a control U_Node, else retain From_Port.

c_lift_inputs :: U_Graph -> UID_t -> [From_Port] -> (UID_t, [From_Port], [U_Node]) Source #

Lift a set of U_NodeU inputs from constants to controls. The result triple gives the incremented UID_t, the transformed From_Port list, and the list of newly minted control U_Nodes.

c_lift_ugen :: U_Graph -> UID_t -> U_Node -> (UID_t, U_Node, [U_Node]) Source #

Lift inputs at U_Node_U as required.

lift_constants :: U_Graph -> U_Graph Source #

Lift constants to controls.

import Sound.SC3 
import Sound.SC3.UGen.Dot 
let u = out 0 (sinOsc AR 440 0 * 0.1)
let g = ugen_to_graph u
draw g
draw (lift_constants g)