hsc3-0.21: Haskell SuperCollider
Safe HaskellSafe-Inferred
LanguageHaskell2010

Sound.Sc3.Ugen.Graph.Transform

Description

Transformations over Graph structure.

Synopsis

Lift constants

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

Transform U_Node_C to U_Node_K, id for other U_Node types.

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

c_lift_from_port :: U_Graph -> Id -> From_Port -> (Id, 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 -> Id -> [From_Port] -> (Id, [From_Port], [U_Node]) Source #

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

c_lift_ugen :: U_Graph -> Id -> U_Node -> (Id, 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 {\- hsc3 -\}
import Sound.Sc3.Ugen.Dot {\- hsc3-dot -\}
let u = out 0 (sinOsc AR 440 0 * 0.1)
let g = ugen_to_graph u
draw g
draw (lift_constants g)