Safe Haskell | None |
---|
Conway's game of life on a 8x8 torus grid, outputting sound.
Press buttons to turn turn them on. The simulation is running only if there is external MIDI sync signal coming (that is, press play in your DAW of choice).
The triangle side buttons trigger predefined patterns (the bottom one erasing the grid).
The directional buttons choose between four different modes of associating notes to the grid cells.
Example usage:
main = runPureApp defaultGlobalConfig $ conway defaultCfg
- data Cfg = Cfg {}
- defaultCfg :: Cfg
- data Scale
- = Chromatic
- | Pentatonic
- | CMinor
- | CMajor
- noteNumber :: Cfg -> Int -> Int
- gridNote :: Cfg -> Dir -> (Int, Int) -> Int
- data Mode = Conway
- data State = State {}
- initialState :: State
- readTable :: [String] -> UArray (Int, Int) Bool
- table0 :: [String]
- table1 :: [String]
- table2 :: [String]
- table3 :: [String]
- table4 :: [String]
- table5 :: [String]
- table6 :: [String]
- predefinedTable :: Int -> UArray (Int, Int) Bool
- conway :: Cfg -> MonadicApp Cfg Mode State
- neighbours :: (Int, Int) -> [(Int, Int)]
- rule :: Bool -> Int -> Bool
- step :: State -> State
- startStop :: Cfg -> Bool -> State -> State
- button :: Cfg -> ButtonPress -> ButtonMonad Mode State ()
- noteOnOff :: Int -> Bool -> MidiMessage'
- sync :: Cfg -> Mode -> Int -> SyncMonad State ()
- render :: Cfg -> Mode -> State -> Maybe Int -> RenderMonad ()
Documentation
noteNumber :: Cfg -> Int -> IntSource
button :: Cfg -> ButtonPress -> ButtonMonad Mode State ()Source
noteOnOff :: Int -> Bool -> MidiMessage'Source