Safe Haskell | None |
---|---|

Language | Haskell98 |

Data flow nodes.

- data DF a where
- K :: K' a => a -> DF a
- A :: Vec Float -> DF (Vec Float)
- R :: K' a => R_Id -> TypeRep -> Either a (DF b, DF a) -> DF b
- P0 :: K' a => String -> TypeRep -> DF a
- P1 :: (K' a, K' b) => String -> TypeRep -> DF a -> DF b
- P2 :: (K' a, K' b, K' c) => String -> TypeRep -> DF a -> DF b -> DF c
- P3 :: (K' a, K' b, K' c, K' d) => String -> TypeRep -> DF a -> DF b -> DF c -> DF d
- MCE :: [DF a] -> DF a
- MRG :: K' a => DF a -> DF () -> DF a

- df_typeOf :: K' a => DF a -> TypeRep
- df_primitive :: DF a -> Maybe String
- mrg :: K' a => DF a -> DF () -> DF a
- df_vec :: V_Id -> [Float] -> DF (Vec Float)
- df_vec_m :: UId m => [Float] -> m (DF (Vec Float))
- df_vec_size :: DF a -> Maybe Int
- df_tbl_size :: DF a -> Maybe Int
- type Unary_Op a = a -> a
- type Binary_Op a = a -> a -> a
- type Ternary_Op a = a -> a -> a -> a
- type Quaternary_Op a = a -> a -> a -> a -> a
- type Quinary_Op a = a -> a -> a -> a -> a -> a
- type Senary_Op a = a -> a -> a -> a -> a -> a -> a
- type Binary_Fn i o = i -> i -> o
- is_mce :: DF t -> Bool
- mce_degree :: DF t -> Int
- mce_extend :: Int -> DF t -> [DF t]
- mce2 :: DF a -> DF a -> DF a
- unmce :: DF t -> [DF t]
- unmce2 :: Show t => DF t -> (DF t, DF t)
- lift_mce :: (DF a -> DF b) -> DF a -> DF b
- lift_mce2 :: (DF a -> DF b -> DF c) -> DF a -> DF b -> DF c
- mce_extend3 :: DF a -> DF b -> DF c -> ([DF a], [DF b], [DF c])
- lift_mce3 :: (DF a -> DF b -> DF c -> DF d) -> DF a -> DF b -> DF c -> DF d
- mk_p1 :: (K' a, K' b) => String -> TypeRep -> DF a -> DF b
- mk_uop :: K' a => String -> Unary_Op (DF a)
- mk_p2 :: (K' a, K' b, K' c) => String -> TypeRep -> DF a -> DF b -> DF c
- mk_binop :: K' a => String -> Binary_Op (DF a)
- mk_p3 :: (K' a, K' b, K' c, K' d) => String -> TypeRep -> DF a -> DF b -> DF c -> DF d
- mk_ternaryop :: K' a => String -> Ternary_Op (DF a)
- df_mul_add :: K_Num a => DF a -> DF a -> DF a -> DF a
- df_add_optimise :: K_Num a => DF a -> DF a -> DF a
- df_bw_and :: DF Int32 -> DF Int32 -> DF Int32
- df_bw_or :: DF Int32 -> DF Int32 -> DF Int32
- df_bw_not :: DF Int32 -> DF Int32
- df_eq :: K_Ord a => DF a -> DF a -> DF Bool
- df_lt :: K_Ord a => DF a -> DF a -> DF Bool
- df_gte :: K_Ord a => DF a -> DF a -> DF Bool
- df_gt :: K_Ord a => DF a -> DF a -> DF Bool
- df_lte :: K_Ord a => DF a -> DF a -> DF Bool
- df_max :: K_Ord a => DF a -> DF a -> DF a
- df_min :: K_Ord a => DF a -> DF a -> DF a
- df_float_to_int32 :: DF Float -> DF Int32
- df_int32_to_float :: DF Int32 -> DF Float
- i32_to_normal_f32 :: DF Int32 -> DF Float
- df_mod :: Binary_Op (DF Int32)
- df_fmodf :: Binary_Op (DF Float)
- df_ceilf :: DF Float -> DF Float
- df_floorf :: DF Float -> DF Float
- df_lrintf :: DF Float -> DF Int32
- df_roundf :: DF Float -> DF Float
- rec_r :: K' a => R_Id -> a -> (DF a -> (DF b, DF a)) -> DF b
- rec_m :: (K' a, UId m) => a -> (DF a -> (DF b, DF a)) -> m (DF b)
- rec_h :: (K' a, Show b) => a -> (DF a -> (DF b, DF a)) -> DF b
- rec_mM :: (K' a, UId m) => a -> (DF a -> m (DF b, DF a)) -> m (DF b)
- in1 :: DF Float
- out1 :: DF Float -> DF ()
- out2 :: DF Float -> DF Float -> DF ()
- out3 :: DF Float -> DF Float -> DF Float -> DF ()
- out :: DF Float -> DF ()
- ctl1 :: DF Int32 -> DF Float
- df_and :: DF Bool -> DF Bool -> DF Bool
- df_or :: DF Bool -> DF Bool -> DF Bool
- df_not :: DF Bool -> DF Bool
- select2 :: K' a => DF Bool -> DF a -> DF a -> DF a
- w_sample_rate :: DF Float
- w_kr_nframes :: DF Int32
- w_kr_edge :: DF Bool
- b_read :: DF Int32 -> DF Int32 -> DF Float
- b_write :: DF Int32 -> DF Int32 -> DF Float -> DF ()
- a_read :: DF (Vec Float) -> DF Int32 -> DF Float
- a_write :: DF (Vec Float) -> DF Int32 -> DF Float -> DF ()
- df_erase :: K' a => DF a -> UDF

# DF

Data flow node. K = constant, A = array, R = recursion, P = primitive, MRG = mrg.

K :: K' a => a -> DF a | |

A :: Vec Float -> DF (Vec Float) | |

R :: K' a => R_Id -> TypeRep -> Either a (DF b, DF a) -> DF b | |

P0 :: K' a => String -> TypeRep -> DF a | |

P1 :: (K' a, K' b) => String -> TypeRep -> DF a -> DF b | |

P2 :: (K' a, K' b, K' c) => String -> TypeRep -> DF a -> DF b -> DF c | |

P3 :: (K' a, K' b, K' c, K' d) => String -> TypeRep -> DF a -> DF b -> DF c -> DF d | |

MCE :: [DF a] -> DF a | |

MRG :: K' a => DF a -> DF () -> DF a |

df_typeOf :: K' a => DF a -> TypeRep Source

Typeable instance for `DF`

.

df_typeOf (K (undefined::Int32)) == int32_t df_typeOf (K (undefined::Float)) == float_t df_typeOf (A undefined) == vec_float_t df_typeOf (0::DF Int32) == int32_t df_typeOf (0.0::DF Float) == float_t

# MRG

# DF Vec

df_tbl_size :: DF a -> Maybe Int Source

`df_vec_size`

variant, tables have a guard point.

# Operator types

type Ternary_Op a = a -> a -> a -> a Source

Ternary operator.

type Quaternary_Op a = a -> a -> a -> a -> a Source

Quaternary operator.

type Quinary_Op a = a -> a -> a -> a -> a -> a Source

Quinary operator.

# Uniform function types

# MCE

mce_degree :: DF t -> Int Source

MCE degree, sees into MRG.

mce_extend :: Int -> DF t -> [DF t] Source

MCE extension, sees into MRG, will not reduce.

# Primitive constructors

mk_ternaryop :: K' a => String -> Ternary_Op (DF a) Source

Binary operator.

df_add_optimise :: K_Num a => DF a -> DF a -> DF a Source

Optimising addition primitive. If either input is a multiplier node, unfold to a multiplier-add node.

df_add_optimise (2 * 3) (4::DF Int32) df_add_optimise (2::DF Int32) (3 * 4)

# Bits

# Ord

# Cast

# Integral

# RealFrac

# Backward arcs

rec_r :: K' a => R_Id -> a -> (DF a -> (DF b, DF a)) -> DF b Source

Introduce backward arc with implicit unit delay.

The function receives the previous output as input, initially `y0`

,
and returns a *(feed-forward,feed-backward)* pair.

rec_r (R_Id 0) (0::Int32) ((\i->(i,i)) . (+) 1) rec_r (R_Id 0) (0.0::Float) ((\i->(i,i)) . (+) 1.0)

rec_mM :: (K' a, UId m) => a -> (DF a -> m (DF b, DF a)) -> m (DF b) Source

Variant of `rec_m`

with monadic action in backward arc.

# Primitives

select2 :: K' a => DF Bool -> DF a -> DF a -> DF a Source

If *p* then *q* else *r*. *p* must have type bool, and *q*
and *r* must have equal types.

w_sample_rate :: DF Float Source

Operating sample rate.

w_kr_nframes :: DF Int32 Source

Number of frames in current control period.

b_write :: DF Int32 -> DF Int32 -> DF Float -> DF () Source

Buffer write, write to buffer *p* at index *q* value *r*.