-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Process MIDI events via reactive-banana and JACK -- -- MIDI is the Musical Instrument Digital Interface, JACK is the JACK -- Audio Connection Kit. This package allows to manipulate a sequence of -- MIDI events via JACK. It is intended to be plugged as a playing -- assistant between a MIDI input device (e.g. a keyboard or a controller -- bank) and a MIDI controlled synthesizer (e.g. a software synthesizer -- or an external synthesizer). For software synthesizers see the Haskell -- packages synthesizer-alsa, synthesizer-llvm, -- supercollider-midi, hsc3, YampaSynth or the -- C packages fluidsynth and Timidity. -- -- Applications include: Remapping of channels, controller, instruments, -- keys, Keyboard splitting, Conversion from notes to controllers, Latch -- mode, Convert parallel chords to serial patterns, Automated change of -- MIDI controllers, Delay and echo. -- -- It is intended that you write programs for MIDI stream manipulation. -- It is not intended to provide an executable program with all the -- functionality available in a custom programming interface. It is most -- fun to play with the stream editors in GHCi. However we provide an -- example module that demonstrates various effects. @package reactive-jack @version 0.2 module Reactive.Banana.JACK.Common data Handle Handle :: Client -> Port Input -> Port Output -> Handle client :: Handle -> Client portIn :: Handle -> Port Input portOut :: Handle -> Port Output with :: ReaderT Handle (ExceptionalT All IO) () -> IO () module Reactive.Banana.JACK.Process data Context Context :: IORef AbsoluteTicks -> IORef InQueue -> Client -> Context contextCycleStartRef :: Context -> IORef AbsoluteTicks contextInQueueRef :: Context -> IORef InQueue contextClient :: Context -> Client newtype Schedule Schedule :: Int -> Schedule newtype Reactor t a Reactor :: ReaderT Context (StateT Schedule (Moment t)) a -> Reactor t a runReactor :: Reactor t a -> ReaderT Context (StateT Schedule (Moment t)) a data InEvent InEvent :: (Map Schedule [Handler AbsoluteTicks]) -> [T] -> InEvent inEventBeat :: T InEvent (Map Schedule [Handler AbsoluteTicks]) type InQueue = Map NFrames InEvent type OutQueue = Map NFrames [T] run :: ThrowsErrno e => (forall t. Frameworks t => Event t T -> Event t [T]) -> ReaderT Handle (ExceptionalT e IO) () runM :: ThrowsErrno e => (forall t. Frameworks t => Behavior t AbsoluteTicks -> Event t T -> Reactor t (Event t [T])) -> ReaderT Handle (ExceptionalT e IO) () type Handler a = a -> IO () viewQueueL :: InQueue -> Maybe ((NFrames, Either [Handler AbsoluteTicks] T), InQueue) normalizeInQueue :: InQueue -> InQueue reduceQueueTime :: NFrames -> Map NFrames a -> Map NFrames a process :: Handle -> IORef AbsoluteTicks -> IORef InQueue -> IORef OutQueue -> Handler (NFrames, NFrames) -> Handler T -> NFrames -> ExceptionalT Errno IO () type RelativeTicks = T Reactor Relative Ticks type AbsoluteTicks = T Reactor Absolute Ticks type RelativeSeconds = T Reactor Relative Seconds nframesFromTicks :: RelativeTicks -> NFrames ticksFromNFrames :: NFrames -> RelativeTicks absTicksFromNFrames :: NFrames -> AbsoluteTicks sendBeat :: Context -> Schedule -> Handler AbsoluteTicks -> AbsoluteTicks -> IO () cancelBeats :: Context -> Schedule -> IO () instance Eq Schedule instance Ord Schedule instance Enum Schedule instance Show Schedule instance Functor (Reactor t) instance Applicative (Reactor t) instance Monad (Reactor t) instance Frameworks t => MonadIO (Reactor t) instance MonadFix (Reactor t) instance Reactor Reactor instance Monoid InEvent instance Timed Reactor instance C Reactor instance Moment Reactor module Reactive.Banana.JACK.Example melody :: Event t (pitch, Velocity) -> Event t [Boundary pitch Velocity] time :: Rational -> RelativeSeconds ticks :: Frameworks t => Rational -> Reactor t RelativeTicks getTempo :: (C ev, Frameworks t) => Event t ev -> Reactor t (Behavior t RelativeTicks, Event t ev) loop :: Frameworks t => Behavior t AbsoluteTicks -> Event t T -> Reactor t (Event t [T])