conductive-base-0.1: a library for livecoding and real-time musical applications



This is a module for creating and manipulating mutable generators. Generators contain a source finite list and a counter. Items are retrieved from the list one at a time, and the list loops when the last item has been given.



newGenerator :: [a] -> IO (Generator a)Source

creates a new Generator from the given source list.

swapGenerator :: Generator a -> [a] -> IO [a]Source

swaps the source of a Generator

getCount :: Generator a -> IO IntSource

returns the current value of a counter in a Generator

getGeneratorSource :: Generator a -> IO [a]Source

returns the source of a Generator

resetCounter :: Generator a -> IO ()Source

resets the counter of a Generator

next :: Generator a -> IO aSource

returns the next item from a Generator

nextWithOffset :: Int -> Generator a -> IO aSource

adds the first argument to the counter value of a Generator and returns the corresponding item from the source

nexts :: [Generator b] -> IO [b]Source

given a list of Generators, returns a list containing the next item from all of them

withNext :: Generator a -> (a -> b) -> IO bSource

runs a pure function on the next item from a Generator

newGeneratorStore :: Ord t => (t, [a]) -> IO (Map t (Generator a))Source

creates a Map for storing Generators in

defaultGeneratorStore :: IO (Map [Char] (Generator Double))Source

the defaultGeneratorStore used by the defaultMusicalEnvironment