synthesizer-llvm-0.6: Efficient signal processing using runtime compilation

Safe HaskellNone

Synthesizer.LLVM.Causal.Process

Synopsis

Documentation

class C process => C process whereSource

Methods

simple :: C state => (forall r c. Phi c => a -> state -> T r c (b, state)) -> (forall r. CodeGenFunction r state) -> process a bSource

loopConst :: C c => c -> process (a, c) (b, c) -> process a bSource

Like loop but uses zero as initial value and it does not need a zero as Haskell value.

replicateControlled :: (Undefined x, Phi x) => Int -> process (c, x) x -> process (c, x) xSource

Instances

C T 
C (T p) 

data T a b Source

Instances

Arrow T 
Category T 
C T 
C T 
Functor (T a) 
Applicative (T a) 
(Field b, Real b, RationalConstant b) => Fractional (T a b) 
(PseudoRing b, Real b, IntegerConstant b) => Num (T a b) 
(Field b, RationalConstant b) => C (T a b) 
(PseudoRing b, IntegerConstant b) => C (T a b) 
Additive b => C (T a b) 

amplify :: (C process, IsArithmetic a, IsConst a) => a -> process (Value a) (Value a)Source

amplifyStereo :: (C process, IsArithmetic a, IsConst a) => a -> process (T (Value a)) (T (Value a))Source

apply :: T a b -> T a -> T bSource

applyFst :: T (a, b) c -> T a -> T b cSource

applySnd :: T (a, b) c -> T b -> T a cSource

compose :: T a b -> T b c -> T a cSource

envelope :: (C process, PseudoRing a) => process (a, a) aSource

envelopeStereo :: (C process, PseudoRing a) => process (a, T a) (T a)Source

feedFst :: T a -> T b (a, b)Source

feedSnd :: T a -> T b (b, a)Source

fromModifier :: C process => (Flatten ah, Registers ah ~ al, Flatten bh, Registers bh ~ bl, Flatten ch, Registers ch ~ cl, Flatten sh, Registers sh ~ sl, C sl) => Simple sh ch ah bh -> process (cl, al) blSource

fromSignal :: T b -> T a bSource

toSignal :: T () a -> T aSource

loopZero :: (C process, Additive c, C c) => process (a, c) (b, c) -> process a bSource

feedbackControlledZero :: (C process, Additive c, C c) => process ((ctrl, a), c) b -> process (ctrl, b) c -> process (ctrl, a) bSource

map :: C process => (forall r. a -> CodeGenFunction r b) -> process a bSource

mapAccum :: (C process, C state) => (forall r. a -> state -> CodeGenFunction r (b, state)) -> (forall r. CodeGenFunction r state) -> process a bSource

zipWith :: C process => (forall r. a -> b -> CodeGenFunction r c) -> process (a, b) cSource

mix :: (C process, Additive a) => process (a, a) aSource

pipeline :: (C process, C v, a ~ Element v, Zero v, C v) => process v v -> process a aSource

stereoFromVector :: (C process, IsPrimitive a, IsPrimitive b) => process (Value (Vector D2 a)) (Value (Vector D2 b)) -> process (T (Value a)) (T (Value b))Source

vectorize :: (C process, C va, n ~ Size va, a ~ Element va, C vb, n ~ Size vb, b ~ Element vb) => process a b -> process va vbSource

replaceChannel :: (C process, C va, n ~ Size va, a ~ Element va, C vb, n ~ Size vb, b ~ Element vb) => Int -> process a b -> process va vb -> process va vbSource

Given a vector process, replace the i-th output by output that is generated by a scalar process from the i-th input.

arrayElement :: (C process, Array dim a ~ array, GetValue array index, IsFirstClass a, ValueType array index ~ a, NaturalT index, NaturalT dim, (index :<: dim) ~ True) => index -> process (Value (Array dim a)) (Value a)Source

Read the i-th element from each array.

element :: (C process, IsFirstClass a, GetValue agg index, ValueType agg index ~ a) => index -> process (Value agg) (Value a)Source

Read the i-th element from an aggregate type.

applyStorable :: (Storable a, MakeValueTuple a, ValueTuple a ~ valueA, C valueA, Storable b, MakeValueTuple b, ValueTuple b ~ valueB, C valueB) => T valueA valueB -> Vector a -> Vector bSource

applyStorableChunky :: (Storable a, MakeValueTuple a, ValueTuple a ~ valueA, C valueA, Storable b, MakeValueTuple b, ValueTuple b ~ valueB, C valueB) => T valueA valueB -> Vector a -> Vector bSource

runStorableChunky :: (Storable a, MakeValueTuple a, ValueTuple a ~ valueA, C valueA, Storable b, MakeValueTuple b, ValueTuple b ~ valueB, C valueB) => T valueA valueB -> IO (Vector a -> Vector b)Source

Deprecated: this function will not work when the process itself depends on a lazy storable vector

This function will not work as expected, since feeding a lazy storable vector to the causal process means that createIOContext creates a StablePtr to an IORef refering to a chunk list. The IORef will be created once for all uses of the generated function of type (SVL.Vector a -> SVL.Vector b). This means that the pointer into the chunks list will conflict. An alternative would be to create the StablePtr in a foreign function that calls back to Haskell. But this way is disallowed for foreign finalizers.