AlgoRhythm- Algorithmic music composition

Safe HaskellNone



A MusicGenerator that uses Chaos functions.



defaultMapping :: Mapping n Source #

Default Mapping that just grabs the first element from the list of possible values.

defaultChaosSelector :: Selector (ChaosState n) a Source #

Default Chaos selector, (just grabs the first element from the list).

chaosEntry :: (Enum a, Bounded a) => ChaosState n -> Selector (ChaosState n) a -> Entry (ChaosState n) a Source #

Generates an Entry based on a ChaosState and Selector.

runChaosGenerator :: ChaosState n -> Mapping n -> MusicGenerator (ChaosState n) a -> IO a Source #

Runs a generator on the chaos state.

playChaosGen :: ToMusicCore a => ChaosState n -> Mapping n -> MusicGenerator (ChaosState n) (Music a) -> IO () Source #

Generates music and plays it using Midi on device 0.

buildChaos Source #


:: Vec n Double

Initial variable values

-> Vec n (Vec n Double -> Double)

Functions that calculate next variable values

-> ChaosState n 

Builds a ChaosState from two Vectors of the same length. This constraint is imposed since the number of variables should be equal to the number of update functions.

data ChaosState n Source #

The default ChaosState that is used for Chaotic generation.



type ChaosGenerator n = StateT (ChaosState n) IO Source #

The `ChaosState wrapped in a StateT monad.`

genNextIteration :: ChaosGenerator n [Double] Source #

Calculates the next iteration of values for the ChaosState.