- getTimeSeconds :: C time => IO time
- clockTimeToSeconds :: C time => ClockTime -> time
- wait :: C time => time -> IO ()
- type StampedEvent time = (time, T)
- getStampedEvent :: (C time, AllowInput mode) => T mode -> IO (StampedEvent time)
- getWaitingStampedEvents :: (C time, AllowInput mode) => T mode -> IO [StampedEvent time]
- getEventsUntilEcho_ :: (C time, AllowInput mode) => T mode -> IO [StampedEvent time]
- getEventsUntilEcho :: AllowInput mode => T -> T mode -> IO [T]
- getWaitingEvents :: AllowInput mode => T mode -> IO [T]
- type StrictTime = Integer
- chopLongTime :: StrictTime -> [StrictTime]
- withMIDIEvents :: C time => time -> time -> (T StrictTime [T] -> IO a) -> IO a
- withMIDIEventsNonblockWaitGrouped :: C time => time -> time -> (T StrictTime [T] -> IO a) -> IO a
- withMIDIEventsNonblockWaitDefer :: C time => time -> time -> (T StrictTime (Maybe T) -> IO a) -> IO a
- withMIDIEventsNonblockWaitSkip :: C time => time -> time -> (T StrictTime (Maybe T) -> IO a) -> IO a
- withMIDIEventsNonblockWaitMin :: C time => time -> time -> (T StrictTime (Maybe T) -> IO a) -> IO a
- withMIDIEventsNonblockConstantPause :: C time => time -> time -> (T StrictTime (Maybe T) -> IO a) -> IO a
- withMIDIEventsNonblockSimple :: C time => time -> time -> (T StrictTime T -> IO a) -> IO a
- withMIDIEventsBlockEcho :: C time => time -> time -> (T StrictTime [T] -> IO a) -> IO a
- makeEcho :: C time => T -> T -> T -> time -> Custom -> T
- withMIDIEventsBlock :: C time => time -> (T StrictTime T -> IO a) -> IO a
- withInPort :: BlockMode -> (T DuplexMode -> T -> IO t) -> IO t
- discretizeTime :: C time => time -> T time a -> T StrictTime a
- type Filter = State (T StrictTime [T])
- type LazyTime = T Integer
- getSlice :: (T -> Maybe a) -> Filter (T StrictTime [a])
- type Channel = Channel
- type Controller = Controller
- type Pitch = Pitch
- type Velocity = Velocity
- type Program = Program
- maybeAnyController :: Channel -> T -> Maybe (Controller, Int)
- maybeController :: Channel -> Controller -> T -> Maybe Int
- getControllerEvents :: Channel -> Controller -> Filter (T StrictTime [Int])
- maybePitchBend :: Channel -> T -> Maybe Int
- maybeChannelPressure :: Channel -> T -> Maybe Int
- data NoteBoundary a
- = NoteBoundary Pitch Velocity a
- | AllNotesOff
- data Note = Note Program Pitch Velocity LazyTime
- getNoteEvents :: Channel -> Filter (T StrictTime [Either Program (NoteBoundary Bool)])
- embedPrograms :: Program -> T StrictTime [Either Program (NoteBoundary Bool)] -> T StrictTime [NoteBoundary (Maybe Program)]
- matchNoteEvents :: T StrictTime [NoteBoundary (Maybe Program)] -> T StrictTime [Note]
- matchNoteEventsCore :: (noteBnd -> Maybe (noteBnd -> Bool, LazyTime -> Note)) -> T StrictTime [noteBnd] -> T StrictTime [Note]
- durationRemove :: C time => (body -> Bool) -> T time [body] -> (T time, T time [body])
- durationRemoveTB :: C time => (body -> Bool) -> T time [body] -> (T time, T time [body])
- makeInstrumentArray :: [instr] -> Array Program instr
- getInstrumentFromArray :: Array Program instr -> Program -> Program -> instr
- ioToLazyList :: IO a -> IO [a]
- lazySequence :: [IO a] -> IO [a]
Documentation
getTimeSeconds :: C time => IO timeSource
clockTimeToSeconds :: C time => ClockTime -> timeSource
type StampedEvent time = (time, T)Source
getStampedEvent :: (C time, AllowInput mode) => T mode -> IO (StampedEvent time)Source
only use it for non-blocking sequencers
We ignore ALSA time stamps and use the time of fetching the event, because I don't know whether the ALSA time stamps are in sync with getClockTime.
getWaitingStampedEvents :: (C time, AllowInput mode) => T mode -> IO [StampedEvent time]Source
only use it for non-blocking sequencers
getEventsUntilEcho_ :: (C time, AllowInput mode) => T mode -> IO [StampedEvent time]Source
only use it for blocking sequencers
getEventsUntilEcho :: AllowInput mode => T -> T mode -> IO [T]Source
getWaitingEvents :: AllowInput mode => T mode -> IO [T]Source
type StrictTime = IntegerSource
chopLongTime :: StrictTime -> [StrictTime]Source
Returns a list of non-zero times.
withMIDIEvents :: C time => time -> time -> (T StrictTime [T] -> IO a) -> IO aSource
withMIDIEventsNonblockWaitGrouped :: C time => time -> time -> (T StrictTime [T] -> IO a) -> IO aSource
withMIDIEventsNonblockWaitDefer :: C time => time -> time -> (T StrictTime (Maybe T) -> IO a) -> IO aSource
withMIDIEventsNonblockWaitSkip :: C time => time -> time -> (T StrictTime (Maybe T) -> IO a) -> IO aSource
withMIDIEventsNonblockWaitMin :: C time => time -> time -> (T StrictTime (Maybe T) -> IO a) -> IO aSource
withMIDIEventsNonblockConstantPause :: C time => time -> time -> (T StrictTime (Maybe T) -> IO a) -> IO aSource
withMIDIEventsNonblockSimple :: C time => time -> time -> (T StrictTime T -> IO a) -> IO aSource
withMIDIEventsBlockEcho :: C time => time -> time -> (T StrictTime [T] -> IO a) -> IO aSource
withMIDIEventsBlock :: C time => time -> (T StrictTime T -> IO a) -> IO aSource
withInPort :: BlockMode -> (T DuplexMode -> T -> IO t) -> IO tSource
discretizeTime :: C time => time -> T time a -> T StrictTime aSource
We first discretize the absolute time values, then we compute differences, in order to avoid rounding errors in further computations.
event filters
getSlice :: (T -> Maybe a) -> Filter (T StrictTime [a])Source
We turn the strict time values into lazy ones according to the breaks by our beat. However for the laziness breaks we ignore the events that are filtered out. That is we loose laziness granularity but hopefully gain efficiency by larger blocks.
type Controller = ControllerSource
maybeAnyController :: Channel -> T -> Maybe (Controller, Int)Source
maybeController :: Channel -> Controller -> T -> Maybe IntSource
getControllerEvents :: Channel -> Controller -> Filter (T StrictTime [Int])Source
data NoteBoundary a Source
Eq a => Eq (NoteBoundary a) | |
Show a => Show (NoteBoundary a) |
getNoteEvents :: Channel -> Filter (T StrictTime [Either Program (NoteBoundary Bool)])Source
embedPrograms :: Program -> T StrictTime [Either Program (NoteBoundary Bool)] -> T StrictTime [NoteBoundary (Maybe Program)]Source
matchNoteEvents :: T StrictTime [NoteBoundary (Maybe Program)] -> T StrictTime [Note]Source
matchNoteEventsCore :: (noteBnd -> Maybe (noteBnd -> Bool, LazyTime -> Note)) -> T StrictTime [noteBnd] -> T StrictTime [Note]Source
durationRemove :: C time => (body -> Bool) -> T time [body] -> (T time, T time [body])Source
Search for specific event, return its time stamp and remove it.
makeInstrumentArray :: [instr] -> Array Program instrSource
ioToLazyList :: IO a -> IO [a]Source
lazySequence :: [IO a] -> IO [a]Source