AlgoRhythm-0.1.0.0: Algorithmic music composition

Safe HaskellNone
LanguageHaskell2010

Generate.Chaos

Description

A MusicGenerator that uses Chaos functions.

Synopsis

Documentation

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 #

Arguments

:: 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.

Constructors

ChaosState 

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.