haskore-realtime-0.0.2: Routines for realtime playback of Haskore songsSource codeContentsIndex
Haskore.RealTime.EventList.TimeBody
Description
Apply actions to event lists (starting with time, ending with body) at given times.
Synopsis
T (Cons, decons)
mapBodyM
mapM
mapM_
getBodies
mapBody
mapTime
mapTimeTail
empty
singleton
null
viewL
viewTimeL
viewBodyL
cons
snoc
consBody
consTime
append
concat
cycle
insert
decreaseStart
delay
partition
foldr
slice
normalize
collectCoincident
flatten
mapCoincident
resample
toAbsoluteEventList
run :: (RealFrac time, MonadIO io) => T -> (body -> io a) -> T time body -> io [a]
runTimeStamp :: (RealFrac time, MonadIO io) => T -> (time -> body -> io a) -> T time body -> io [a]
runTimeStampGrouped :: (RealFrac time, MonadIO io) => T -> (time -> [body] -> io a) -> T time body -> io [a]
runCore :: (Fractional time0, RealFrac time1, MonadIO io) => (T time0 body0 -> T time1 body1) -> T -> (time1 -> body1 -> io a) -> T time0 body0 -> io [a]
runRelative :: (C time, RealFrac time, MonadIO io) => T -> (body -> io a) -> T time body -> io [a]
runRelativeCore :: MonadIO io => T -> (body -> io a) -> T Integer body -> io [a]
attachTime :: T time body -> T time (time, body)
Documentation
T (Cons, decons)
mapBodyM
mapM
mapM_
getBodies
mapBody
mapTime
mapTimeTail
empty
singleton
null
viewL
viewTimeL
viewBodyL
cons
snoc
consBody
consTime
append
concat
cycle
insert
decreaseStart
delay
partition
foldr
slice
normalize
collectCoincident
flatten
mapCoincident
resample
toAbsoluteEventList
run :: (RealFrac time, MonadIO io) => T -> (body -> io a) -> T time body -> io [a]Source

The next set of routines is more precise. It computes a time table starting with current system time and tries to stick to it.

So far, I worked hard to use time differences instead of absolute times in order to avoid increasing memory consumption of time numbers (which however slows down as time evolves) but the time related functions of the system are absolute, so have to make our ones absolute as well.

runTimeStamp :: (RealFrac time, MonadIO io) => T -> (time -> body -> io a) -> T time body -> io [a]Source
The wait calls are necessarily quantized, but the time passed to the action is not quantized.
runTimeStampGrouped :: (RealFrac time, MonadIO io) => T -> (time -> [body] -> io a) -> T time body -> io [a]Source
This routine is only necessary, because differences might be too small to be noticed in the absolute time values. That is, collectCoincident will split events which actually belong together.
runCore :: (Fractional time0, RealFrac time1, MonadIO io) => (T time0 body0 -> T time1 body1) -> T -> (time1 -> body1 -> io a) -> T time0 body0 -> io [a]Source
runRelative :: (C time, RealFrac time, MonadIO io) => T -> (body -> io a) -> T time body -> io [a]Source
The first function assumes, that the action does not consume time and that the wait command is precise. It is not very useful in practice, but very simple.
runRelativeCore :: MonadIO io => T -> (body -> io a) -> T Integer body -> io [a]Source
attachTime :: T time body -> T time (time, body)Source
We export this function only for use in Haskore.RealTime.EventList.TimeTime.
Produced by Haddock version 2.4.2