jack-0.7.2.1: Bindings for the JACK Audio Connection Kit

Safe HaskellNone
LanguageHaskell98

Sound.JACK.MIDI

Synopsis

Documentation

data RawEvent Source #

Represents a raw JACK MIDI event

rawEvent Source #

Arguments

:: NFrames

Sample index at which event is valid (relative to cycle start)

-> ByteString

Raw MIDI data

-> RawEvent 

Smart constructor for a raw MIDI event.

toRawEventFunction Source #

Arguments

:: (NFrames -> (NFrames, T) -> IO (NFrames, T))

transforms Sound.MIDI.File.Event

-> NFrames -> RawEvent -> IO RawEvent

transforms Sound.JACK.MIDI.RawEvent

Converts high level MIDI Event transformation functions into raw MIDI Event transformation functions

type Port = Port EventBuffer Source #

withPort Source #

Arguments

:: (Direction dir, ThrowsPortRegister e, ThrowsErrno e) 
=> Client

Jack client

-> String

name of the input port

-> (Port dir -> ExceptionalT e IO a) 
-> ExceptionalT e IO a 

withProcess Source #

Arguments

:: ThrowsErrno e 
=> Client

the JACK Client, whose process loop will be set

-> Port Input

where to get events from

-> (NFrames -> RawEvent -> IO RawEvent)

transforms input to output events

-> Port Output

where to put events

-> ExceptionalT e IO a 
-> ExceptionalT e IO a

exception causing JACK to remove that client from the process() graph.

sets the process loop of the JACK Client

data Buffer dir Source #

getBuffer :: Direction dir => Port dir -> NFrames -> IO (Buffer dir) Source #

readRawEvents Source #

Arguments

:: ThrowsErrno e 
=> Buffer Input

the PortBuffer to read from

-> ExceptionalT e IO [RawEvent] 

reads all available MIDI Events on the given PortBuffer

writeRawEvent Source #

Arguments

:: ThrowsErrno e 
=> Buffer Output

the PortBuffer of the MIDI output to write to

-> RawEvent

the RawEvent to write

-> ExceptionalT e IO () 

writes a MIDI event to the PortBuffer of a MIDI output or throws eNOBUFS if JackMIDI.buffer is full

writeRawEventsToPort :: ThrowsErrno e => Port Output -> NFrames -> [RawEvent] -> ExceptionalT e IO () Source #

Clears an output buffer and writes a sequence of events to it. That is, you must only call this function once per callback.

readEventsFromPort :: ThrowsErrno e => Port Input -> NFrames -> ExceptionalT e IO (T NFrames T) Source #

Reads midi events from an input buffer and converts them to a high-level representation. Messages are simply ignored if they cannot be parsed.

writeEventsToPort :: ThrowsErrno e => Port Output -> NFrames -> T NFrames T -> ExceptionalT e IO () Source #

Clears an output buffer and writes a sequence of events to it. That is, you must only call this function once per callback.

main Source #

Arguments

:: (NFrames -> (NFrames, T) -> IO (NFrames, T))

transforms input to output events

-> IO () 

Creates an input and an output, and transforms all input events into output events using the given function

mainRaw Source #

Arguments

:: (NFrames -> RawEvent -> IO RawEvent)

transforms raw input to output events

-> IO () 

Creates an input and an output, and transforms all raw input events into raw output events using the given function