Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Utility function over Ugen data structure.
Synopsis
- toUid :: ID a => a -> UgenId
- ugenTraverse :: (Ugen -> Bool) -> (Ugen -> Ugen) -> Ugen -> Ugen
- ugenFoldr :: (Ugen -> a -> a) -> a -> Ugen -> a
- ugenCollectBrackets :: Ugen -> Brackets
- ugenHasAnyBrackets :: Ugen -> Bool
- control_f64 :: Rate -> Maybe Int -> String -> Sample -> Ugen
- control :: Rate -> String -> Double -> Ugen
- control_m :: Rate -> String -> Double -> Control_Meta_T3 Double -> Ugen
- control_pair :: Control_Group -> Rate -> String -> (Double, Double) -> Control_Meta_T3 Double -> (Ugen, Ugen)
- control_rng :: Rate -> String -> (Double, Double) -> Control_Meta_T3 Double -> (Ugen, Ugen)
- trigControl_f64 :: Maybe Int -> String -> Sample -> Ugen
- trigControl :: String -> Double -> Ugen
- control_set :: [Ugen] -> [Ugen]
- mce1 :: Ugen -> Ugen
- mce2 :: Ugen -> Ugen -> Ugen
- mce2c :: Ugen -> (Ugen, Ugen)
- unmce2 :: Ugen -> (Ugen, Ugen)
- mce3 :: Ugen -> Ugen -> Ugen -> Ugen
- unmce3 :: Ugen -> (Ugen, Ugen, Ugen)
- mceMap :: (Ugen -> Ugen) -> Ugen -> Ugen
- map_ix :: ((Int, a) -> b) -> [a] -> [b]
- mce_map_ix :: ((Int, Ugen) -> Ugen) -> Ugen -> Ugen
- mceEdit :: ([Ugen] -> [Ugen]) -> Ugen -> Ugen
- mceReverse :: Ugen -> Ugen
- mceChannel :: Int -> Ugen -> Ugen
- mceChannelWrap :: Int -> Ugen -> Ugen
- mceTranspose :: Ugen -> Ugen
- mceRotate :: Int -> Ugen -> Ugen
- mceConcat :: [Ugen] -> Ugen
- mceClump :: Int -> Ugen -> Ugen
- mceReduce :: (Ugen -> Ugen -> Ugen) -> Ugen -> Ugen
- mceProduct :: Ugen -> Ugen
- halt_mce_transform_f :: (a -> [a]) -> [a] -> [a]
- halt_mce_transform :: [Ugen] -> [Ugen]
- prepare_root :: Ugen -> Ugen
- mrg2 :: Ugen -> Ugen -> Ugen
- label :: String -> Ugen
- unpackLabel :: Bool -> Ugen -> [Ugen]
- envelope_to_ugen :: Envelope Ugen -> Ugen
- envelope_to_ienvgen_ugen :: Envelope Ugen -> Ugen
- bitAnd :: Ugen -> Ugen -> Ugen
- bitOr :: Ugen -> Ugen -> Ugen
- bitXOr :: Ugen -> Ugen -> Ugen
- bitNot :: Ugen -> Ugen
- shiftLeft :: Ugen -> Ugen -> Ugen
- shiftRight :: Ugen -> Ugen -> Ugen
- unsignedShift :: Ugen -> Ugen -> Ugen
- (.<<.) :: Ugen -> Ugen -> Ugen
- (.>>.) :: Ugen -> Ugen -> Ugen
- rewriteUgenRates :: (Rate -> Bool) -> Rate -> Ugen -> Ugen
- rewriteToControlRate :: Ugen -> Ugen
- rewriteToDemandRate :: Ugen -> Ugen
- rewriteToInitialisationRate :: Ugen -> Ugen
- rewriteToRate :: Rate -> Ugen -> Ugen
Documentation
Ugen graph functions
ugenTraverse :: (Ugen -> Bool) -> (Ugen -> Ugen) -> Ugen -> Ugen Source #
Depth first traversal of graph at u
, stopping at halt_f
, else applying map_f
to each node.
ugenFoldr :: (Ugen -> a -> a) -> a -> Ugen -> a Source #
Right fold of Ugen graph.
map Sound.Sc3.Ugen.PP.ugen_concise_pp $ ugenFoldr (:) [] (sinOsc ar 440 0 * 0.1) map Sound.Sc3.Ugen.PP.ugen_concise_pp $ ugenFoldr (:) [] (pan2 (sinOsc ar 440 0) 0.25 0.1)
ugenCollectBrackets :: Ugen -> Brackets Source #
Fold over Ugen and collect all bracketing messages from all Primitive nodes.
ugenHasAnyBrackets :: Ugen -> Bool Source #
Are there any brackets at Ugen.
Unit generator node constructors
control_f64 :: Rate -> Maybe Int -> String -> Sample -> Ugen Source #
Control input node constructor.
control :: Rate -> String -> Double -> Ugen Source #
Control input node constructor.
Note that if the name begins with a t_ prefix the control is not
converted to a triggered control. Please see trigControl
.
control_m :: Rate -> String -> Double -> Control_Meta_T3 Double -> Ugen Source #
Variant of control
with meta data.
control_pair :: Control_Group -> Rate -> String -> (Double, Double) -> Control_Meta_T3 Double -> (Ugen, Ugen) Source #
Generate group of two controls. Names are generated according to control_group_suffixes
control_rng :: Rate -> String -> (Double, Double) -> Control_Meta_T3 Double -> (Ugen, Ugen) Source #
Generate range controls. Names are generated according to control_group_suffixes
trigControl_f64 :: Maybe Int -> String -> Sample -> Ugen Source #
Triggered (kr) control input node constructor.
control_set :: [Ugen] -> [Ugen] Source #
Set indices at a list of controls.
Multiple channel expansion
mce2c :: Ugen -> (Ugen, Ugen) Source #
Extract two channels from possible Mce, if there is only one channel it is duplicated.
unmce3 :: Ugen -> (Ugen, Ugen, Ugen) Source #
Variant of mce2c
that requires input to have two channels.
mceMap :: (Ugen -> Ugen) -> Ugen -> Ugen Source #
Apply a function to each channel at a unit generator.
mceReverse :: Ugen -> Ugen Source #
Reverse order of channels at Mce.
mceChannelWrap :: Int -> Ugen -> Ugen Source #
Obtain indexed channel at Mce, indicex wrap around.
map (\ix -> mceChannelWrap ix (mce [1,2,3,4,5])) [0 .. 9]
mceTranspose :: Ugen -> Ugen Source #
Transpose rows and columns, ie. {{a,b},{c,d}} to {{a,c},{b,d}}.
mceRotate :: Int -> Ugen -> Ugen Source #
Rotate mce k places to the right, ie. {a,b,c,d} to {d,a,b,c}
mceRotate 1 (mce [1,2,3,4]) == mce [4,1,2,3]
mceConcat :: [Ugen] -> Ugen Source #
concat
at mce channels of each input, ie. {{a,b},{c,d}} to {a,b,c,d}.
mceConcat (map mce [[1,2],[3,4]]) == mce [1..4]
mceClump :: Int -> Ugen -> Ugen Source #
Collect subarrays of mce.
mceClump 2 (mce [1,2,3,4]) == mce2 (mce2 1 2) (mce2 3 4)
mceProduct :: Ugen -> Ugen Source #
mceReduce of *.
Transform
halt_mce_transform_f :: (a -> [a]) -> [a] -> [a] Source #
Given unmce function make halt mce transform.
halt_mce_transform :: [Ugen] -> [Ugen] Source #
The halt Mce transform, ie. lift channels of last input into list. This is not used by hsc3, but it is used by hsc3-forth and stsc3.
halt_mce_transform [1,2,mce2 3 4] == [1,2,3,4]
prepare_root :: Ugen -> Ugen Source #
If the root node of a Ugen graph is mce, transform to mrg.
Multiple root graphs
Labels
unpackLabel :: Bool -> Ugen -> [Ugen] Source #
Unpack a label to a length prefixed list of Constant
s. There
is a special case for mce nodes, but it requires labels to be equal
length. Properly, poll
would not unpack the label, it would be
done by the synthdef builder.
unpackLabel False (label "/tmp")
Envelope
Bitwise
Rate Flow
rewriteUgenRates :: (Rate -> Bool) -> Rate -> Ugen -> Ugen Source #
Traverse graph rewriting audio rate nodes as control rate.
rewriteToControlRate :: Ugen -> Ugen Source #
Traverse graph rewriting audio rate nodes as control rate.
rewriteToDemandRate :: Ugen -> Ugen Source #
Traverse graph rewriting all nodes as demand rate.
rewriteToInitialisationRate :: Ugen -> Ugen Source #
Traverse graph rewriting audio and control nodes as initialisation rate.