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

Language | Haskell2010 |

Support for stateful modifiers like controlled filters. This is similar to Synthesizer.Causal.Process but we cannot replace the Modifier structure by the Causal structure because the Modifier structure exhibits the state which allows stacking of modifiers using an efficient storage for the stacked state. More precisely, because Modifiers exhibits the type of the state, we can ensure that the state type of several modifiers is equal and thus the individual states can be stored in an array or a StorableVector.

## Synopsis

- type T a = [a]
- data Simple s ctrl a b = Simple {}
- static :: Simple s ctrl a b -> ctrl -> T a -> T b
- modulated :: Simple s ctrl a b -> T ctrl -> T a -> T b
- data Initialized s init ctrl a b = Initialized {}
- initialize :: Initialized s init ctrl a b -> init -> Simple s ctrl a b
- staticInit :: Initialized s init ctrl a b -> init -> ctrl -> T a -> T b
- modulatedInit :: Initialized s init ctrl a b -> init -> T ctrl -> T a -> T b
- stackStatesR :: (a -> State s a) -> a -> State [s] a
- stackStatesL :: (a -> State s a) -> a -> State [s] a
- stackStatesStorableR :: Storable s => (a -> State s a) -> a -> State (Vector s) a
- stackStatesStorableL :: Storable s => (a -> State s a) -> a -> State (Vector s) a
- stackStatesStorableVaryL :: (Storable s, Storable c) => (c -> a -> State s a) -> Vector c -> a -> State (Vector s) a

# Documentation

static :: Simple s ctrl a b -> ctrl -> T a -> T b Source #

modif is a process controlled by values of type c with an internal state of type s, it converts an input value of type a into an output value of type b while turning into a new state

ToDo: Shall finite signals be padded with zeros?

modulated :: Simple s ctrl a b -> T ctrl -> T a -> T b Source #

Here the control may vary over the time.

data Initialized s init ctrl a b Source #

initialize :: Initialized s init ctrl a b -> init -> Simple s ctrl a b Source #

staticInit :: Initialized s init ctrl a b -> init -> ctrl -> T a -> T b Source #

modulatedInit :: Initialized s init ctrl a b -> init -> T ctrl -> T a -> T b Source #

Here the control may vary over the time.

stackStatesR :: (a -> State s a) -> a -> State [s] a Source #

The number of stacked state monads depends on the size of the list of state values. This is like a dynamically nested StateT.

stackStatesL :: (a -> State s a) -> a -> State [s] a Source #