-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Binding to the ALSA Library API (MIDI sequencer). -- -- This package provides access to ALSA sequencer (MIDI support). For -- audio support see alsa-pcm. Included are some simple example programs. -- For more example programs including a GUI, see the alsa-gui programs. @package alsa-seq @version 0.6.0.2 module Sound.ALSA.Sequencer.RealTime data T Cons :: !Word32 -> !Word32 -> T secs :: T -> !Word32 nano :: T -> !Word32 -- | Convert fractional number of seconds to T Time must be -- non-negative. fromDouble :: Double -> T fromFractional :: RealFrac a => a -> T -- | Convert number of nanoseconds to T fromInteger :: Integer -> T -- | Convert fractional number of seconds to T toDouble :: T -> Double toFractional :: RealFrac a => T -> a -- | Convert number of nanoseconds to T toInteger :: T -> Integer module Sound.ALSA.Sequencer.Time data T Cons :: Mode -> Stamp -> T mode :: T -> Mode stamp :: T -> Stamp consAbs :: Stamp -> T consRel :: Stamp -> T data Mode Absolute :: Mode Relative :: Mode data Stamp Tick :: !Tick -> Stamp Real :: !T -> Stamp module Sound.ALSA.Sequencer.Address data T Cons :: !T -> !T -> T client :: T -> !T port :: T -> !T unknown :: T -- | The address of all subscribed ports. subscribers :: T broadcast :: T systemTimer :: T systemAnnounce :: T -- | Parse the given string into sequencer address. The client and port are -- separated by either colon or period, e.g. 128:1. The function also -- accepts client names or prefixes thereof. Throws (Errno 2) -- exception if no client name matches. parse :: T mode -> String -> IO T module Sound.ALSA.Sequencer.Query class C info => C info init :: C info => info -> IO () next :: C info => T mode -> info -> IO Bool first :: C info => T mode -> IO info loop_ :: C info => T mode -> (info -> IO ()) -> (info -> IO ()) -> IO () loop :: C info => T mode -> (info -> IO ()) -> (info -> IO a) -> IO [a] module Sound.ALSA.Sequencer.Client.InfoMonad data T a run :: T a -> T -> IO a get :: T mode -> T a -> IO a modify :: T mode -> T a -> IO a getClient :: T T getType :: T Type getName :: T String getBroadcastFilter :: T Bool getErrorBounce :: T Bool getNumPorts :: T Word getEventLost :: T Word setClient :: T -> T () setName :: String -> T () setBroadcastFilter :: Bool -> T () setErrorBounce :: Bool -> T () instance Functor T instance Applicative T instance Monad T -- | This module contains functions for working with sequencer clients. -- Reference: -- http://www.alsa-project.org/alsa-doc/alsa-lib/group___seq_client.html module Sound.ALSA.Sequencer.Client -- | The type of client identifiers. newtype T Cons :: Word8 -> T unknown :: T system :: T subscribers :: T broadcast :: T -- | Get the client identifier for the sequencer. A convinience function. getId :: T mode -> IO T -- | Set the name for the sequencer client. A convinience function. setName :: T mode -> String -> IO () -- | The different types of clients. data Type User :: Type Kernel :: Type -- | This module contains functions for working with sequencer clients. -- Reference: -- http://www.alsa-project.org/alsa-doc/alsa-lib/group___seq_client.html module Sound.ALSA.Sequencer.Client.Info data T get :: T mode -> IO T -- | Copy the content of an object to a newly created object. -- -- Create a new information area filled with data about an arbitrary -- client. getAny :: T mode -> T -> IO T queryFirst :: T mode -> IO T -- | Get information about the client with the next biggest identifier. queryNext :: T mode -> T -> IO Bool queryLoop_ :: T mode -> (T -> IO ()) -> IO () queryLoop :: T mode -> (T -> IO a) -> IO [a] -- | Set the information for the sequencer client based on the data in the -- given information area. set :: T mode -> T -> IO () -- | Create a new information area filled with data about the sequencer -- client. copy :: T -> T -> IO () clone :: T -> IO T getClient :: T -> IO T getType :: T -> IO Type getName :: T -> IO String getBroadcastFilter :: T -> IO Bool -- | Allocate an uninitialized object. (Not exported) getErrorBounce :: T -> IO Bool getNumPorts :: T -> IO Word getEventLost :: T -> IO Word setClient :: T -> T -> IO () setName :: T -> String -> IO () setBroadcastFilter :: T -> Bool -> IO () setErrorBounce :: T -> Bool -> IO () filterClear :: T -> IO () filterAdd :: Type e => T -> e -> IO () filterDel :: Type e => T -> e -> IO () filterCheck :: Type e => T -> e -> IO Bool module Sound.ALSA.Sequencer.Connect data T Cons :: !T -> !T -> T source :: T -> !T dest :: T -> !T reverse :: T -> T toSubscribers :: T -> T fromSubscribers :: T -> T -- | Simple subscription (w/o exclusive & time conversion). createFrom :: AllowInput mode => T mode -> T -> T -> IO T -- | Simple disconnection. deleteFrom :: AllowInput mode => T mode -> T -> T -> IO () -- | Temporary subscription. withFrom :: AllowInput mode => T mode -> T -> T -> (T -> IO a) -> IO a -- | Simple subscription (w/o exclusive & time conversion). createTo :: AllowOutput mode => T mode -> T -> T -> IO T -- | Simple disconnection. deleteTo :: AllowOutput mode => T mode -> T -> T -> IO () -- | Temporary subscription. withTo :: AllowOutput mode => T mode -> T -> T -> (T -> IO a) -> IO a -- | This module contains functions for working with ports. Reference: -- http://www.alsa-project.org/alsa-doc/alsa-lib/group___seq_port.html module Sound.ALSA.Sequencer.Port newtype T Cons :: Word8 -> T -- | Create a new port, as described by the info structure. create :: T mode -> T -> IO () -- | Create a port - simple version. createSimple :: T mode -> String -> Cap -> Type -> IO T -- | Delete the port. delete :: T mode -> T -> IO () -- | Delete the port. deleteSimple :: T mode -> T -> IO () withSimple :: T mode -> String -> Cap -> Type -> (T -> IO a) -> IO a systemTimer :: T systemAnnounce :: T unknown :: T -- | Port capabilities. type Cap = T CUInt CapabilityFlag capRead :: Cap capWrite :: Cap capSyncRead :: Cap capSyncWrite :: Cap capDuplex :: Cap capSubsRead :: Cap capSubsWrite :: Cap capNoExport :: Cap caps :: [Cap] -> Cap -- | Port types. type Type = T CUInt TypeFlag typeSpecific :: Type typeMidiGeneric :: Type typeMidiGM :: Type typeMidiGS :: Type typeMidiXG :: Type typeMidiMT32 :: Type typeMidiGM2 :: Type typeSynth :: Type typeDirectSample :: Type typeSample :: Type typeHardware :: Type typeSoftware :: Type typeSynthesizer :: Type typePort :: Type typeApplication :: Type types :: [Type] -> Type -- | This module contains functions for working with ports. Reference: -- http://www.alsa-project.org/alsa-doc/alsa-lib/group___seq_port.html module Sound.ALSA.Sequencer.Port.Info data T -- | Set the information for the sequencer port based on the data in the -- given information area. get :: T mode -> T -> IO T getAny :: T mode -> T -> T -> IO T -- | Get information about the first port on our client. queryFirst :: T mode -> IO T -- | Get information about the port with the next biggest identifier. If a -- matching port is found, then its information is stored in the given -- area and True is returned. queryNext :: T mode -> T -> IO Bool queryLoop_ :: T mode -> T -> (T -> IO ()) -> IO () queryLoop :: T mode -> T -> (T -> IO a) -> IO [a] set :: T mode -> T -> T -> IO () copy :: T -> T -> IO () clone :: T -> IO T getPort :: T -> IO T getClient :: T -> IO T getAddr :: T -> IO T getName :: T -> IO String getCapability :: T -> IO Cap getMidiChannels :: T -> IO Word getMidiVoices :: T -> IO Word -- | Copy the content of an object to a newly created object. getSynthVoices :: T -> IO Word getPortSpecified :: T -> IO Bool -- | Copy the content of one object into another. getTimestamping :: T -> IO Bool getTimestampReal :: T -> IO Bool getTimestampQueue :: T -> IO T getReadUse :: T -> IO Word getWriteUse :: T -> IO Word setPort :: T -> T -> IO () setClient :: T -> T -> IO () setAddr :: T -> T -> IO () setName :: T -> String -> IO () setCapability :: T -> Cap -> IO () setMidiChannels :: T -> Word -> IO () setSynthVoices :: T -> Word -> IO () setMidiVoices :: T -> Word -> IO () setPortSpecified :: T -> Bool -> IO () setTimestamping :: T -> Bool -> IO () setTimestampReal :: T -> Bool -> IO () -- | Set the port address. setTimestampQueue :: T -> T -> IO () -- | This module contains functions for working with ports. Reference: -- http://www.alsa-project.org/alsa-doc/alsa-lib/group___seq_port.html module Sound.ALSA.Sequencer.Port.InfoMonad data T a run :: T a -> T -> IO a get :: T mode -> T -> T a -> IO a modify :: T mode -> T -> T a -> IO a getPort :: T T getClient :: T T getAddr :: T T getName :: T String getCapability :: T Cap getMidiChannels :: T Word getMidiVoices :: T Word getSynthVoices :: T Word getPortSpecified :: T Bool getTimestamping :: T Bool getTimestampReal :: T Bool getTimestampQueue :: T T getReadUse :: T Word getWriteUse :: T Word setPort :: T -> T () setClient :: T -> T () setAddr :: T -> T () setName :: String -> T () setCapability :: Cap -> T () setMidiChannels :: Word -> T () setSynthVoices :: Word -> T () setMidiVoices :: Word -> T () setPortSpecified :: Bool -> T () setTimestamping :: Bool -> T () setTimestampReal :: Bool -> T () setTimestampQueue :: T -> T () instance Functor T instance Applicative T instance Monad T -- | This module contains functions for working with sequencer queue. -- Reference: -- http://www.alsa-project.org/alsa-doc/alsa-lib/group___seq_queue.html module Sound.ALSA.Sequencer.Queue -- | The type of queue identifiers. data T direct :: T alloc :: T mode -> IO T allocNamed :: T mode -> String -> IO T -- | Delete the specified queue. free :: T mode -> T -> IO () with :: T mode -> (T -> IO a) -> IO a withNamed :: T mode -> String -> (T -> IO a) -> IO a -- | startstopcontinue a queue -- -- In the prototype event you can provide additional information. The -- prototype event does not need to be a queue control event, this part -- is ignored anyway. In the prototype event you may also specify a -- queue. This is the queue that the timestamp of the prototype event -- refers to. This way you can control the target queue using timing from -- another queue. control :: T mode -> T -> QueueEv -> Maybe T -> IO () -- | This module contains functions for working with events. Reference: -- http://www.alsa-project.org/alsa-doc/alsa-lib/group___seq_event.html module Sound.ALSA.Sequencer.Event -- | Output an event and drain the buffer, if it became full. Throws -- exceptions. See also: outputDirect, outputBuffer, -- outputPending, drainOutput, dropOutput, -- extractOutput, removeOutput output :: AllowOutput mode => T mode -> T -> IO Word -- | Output an event without draining the buffer. Throws -EAGAIN -- if the buffer becomes full. See also output. outputBuffer :: AllowOutput mode => T mode -> T -> IO Word -- | Output an event directly to the sequencer, NOT through the output -- buffer. If an error occurs, then we throw an exception. See also -- output. outputDirect :: AllowOutput mode => T mode -> T -> IO Word -- | Return the size (in bytes) of pending events on output buffer. See -- also output. outputPending :: AllowOutput mode => T mode -> IO Word -- | Extract the first event in output buffer. Throws (Errno 2) -- exception if output buffer is empty. See also output. extractOutput :: AllowOutput mode => T mode -> IO T -- | Remove the first event in output buffer. Throws an exception on error. -- See also output. removeOutput :: AllowOutput mode => T mode -> IO () -- | Drain output buffer to sequencer. This function drains all pending -- events on the output buffer. The function returns immediately after -- the events are sent to the queues regardless whether the events are -- processed or not. To get synchronization with the all event processes, -- use syncOutputQueue after calling this function. Throws an -- exception on error. See also: output, syncOutputQueue. drainOutput :: AllowOutput mode => T mode -> IO Word -- | Remove events from both the user-space output buffer, and the -- kernel-space sequencer queue. See also: drainOutput, -- dropOutputBuffer, removeOutput. dropOutput :: AllowOutput mode => T mode -> IO () -- | Remove events from the user-space output buffer. See also: -- dropOutput. dropOutputBuffer :: AllowOutput mode => T mode -> IO () -- | Wait until all events of the client are processed. syncOutputQueue :: T mode -> IO () -- | Get an event from the input buffer. If the input buffer is empty, then -- it is filled with data from the sequencer queue. If there is no data -- in the sequencer queue, then the process is either put to sleep (if -- the sequencer is operating in blocking mode), or we throw -- EAGAIN (if the sequence is operating in non-blocking mode). -- -- We may also throw ENOSPC, which means that the sequencer -- queue over-run and some events were lost (this clears the input -- buffer). input :: AllowInput mode => T mode -> IO T -- | Returns the number of events in the input buffer. If the input buffer -- is empty and the boolean argument is true, then try to fill the input -- buffer with data from the sequencer queue. See also: input. inputPending :: AllowInput mode => T mode -> Bool -> IO Word -- | Remove events from both the user-space input buffer, and the -- kernel-space sequencer queue. See also: dropInputBuffer, -- removeOutput. dropInput :: AllowInput mode => T mode -> IO () -- | Remove events from the user-space input buffer. See also: -- dropInput. dropInputBuffer :: AllowInput mode => T mode -> IO () data T Cons :: !Bool -> !Tag -> !T -> !T -> !T -> !T -> !Data -> T highPriority :: T -> !Bool tag :: T -> !Tag queue :: T -> !T time :: T -> !T source :: T -> !T dest :: T -> !T body :: T -> !Data -- | Construct an ALSA sequencer event from very few information. Most -- fields are initialized with sensible defaults. You may use this as a -- start and alter its fields for your special needs. -- --
-- (Event.simple myAddr (Event.simpleNote (Event.Channel 0) (Event.Pitch 60) Event.normalVelocity)) {Event.dest = destAddr}
--
simple :: T -> Data -> T
forSourcePort :: T -> Data -> T
forConnection :: T -> Data -> T
data Data
NoteEv :: NoteEv -> Note -> Data
CtrlEv :: CtrlEv -> Ctrl -> Data
QueueEv :: QueueEv -> T -> Data
AddrEv :: AddrEv -> T -> Data
ConnEv :: ConnEv -> T -> Data
EmptyEv :: EmptyEv -> Data
CustomEv :: CustomEv -> Custom -> Data
ExtEv :: ExtEv -> ByteString -> Data
class Type e
data NoteEv
ANote :: NoteEv
NoteOn :: NoteEv
NoteOff :: NoteEv
KeyPress :: NoteEv
data Note
Note :: !Channel -> !Pitch -> !Velocity -> !Velocity -> !Duration -> Note
noteChannel :: Note -> !Channel
noteNote :: Note -> !Pitch
noteVelocity :: Note -> !Velocity
noteOffVelocity :: Note -> !Velocity
noteDuration :: Note -> !Duration
-- | Make a note whose unspecified fields contain 0.
simpleNote :: Channel -> Pitch -> Velocity -> Note
data CtrlEv
Controller :: CtrlEv
PgmChange :: CtrlEv
ChanPress :: CtrlEv
PitchBend :: CtrlEv
Control14 :: CtrlEv
NonRegParam :: CtrlEv
RegParam :: CtrlEv
SongPos :: CtrlEv
SongSel :: CtrlEv
QFrame :: CtrlEv
TimeSign :: CtrlEv
KeySign :: CtrlEv
data Ctrl
Ctrl :: !Channel -> !Parameter -> !Value -> Ctrl
ctrlChannel :: Ctrl -> !Channel
ctrlParam :: Ctrl -> !Parameter
ctrlValue :: Ctrl -> !Value
data CustomEv
Echo :: CustomEv
OSS :: CustomEv
User0 :: CustomEv
User1 :: CustomEv
User2 :: CustomEv
User3 :: CustomEv
User4 :: CustomEv
User5 :: CustomEv
User6 :: CustomEv
User7 :: CustomEv
User8 :: CustomEv
User9 :: CustomEv
data Custom
Custom :: !Word32 -> !Word32 -> !Word32 -> Custom
custom0 :: Custom -> !Word32
custom1 :: Custom -> !Word32
custom2 :: Custom -> !Word32
customZero :: Custom
data ExtEv
SysEx :: ExtEv
Bounce :: ExtEv
UserVar0 :: ExtEv
UserVar1 :: ExtEv
UserVar2 :: ExtEv
UserVar3 :: ExtEv
UserVar4 :: ExtEv
data QueueEv
QueueStart :: QueueEv
QueueContinue :: QueueEv
QueueStop :: QueueEv
QueueSetPosTick :: !Tick -> QueueEv
QueueSetPosTime :: !T -> QueueEv
QueueTempo :: !Tempo -> QueueEv
QueueClock :: QueueEv
QueueTick :: QueueEv
QueueSkew :: !Skew -> QueueEv
QueueSyncPos :: !Position -> QueueEv
data AddrEv
ClientStart :: AddrEv
ClientExit :: AddrEv
ClientChange :: AddrEv
PortStart :: AddrEv
PortExit :: AddrEv
PortChange :: AddrEv
data ConnEv
PortSubscribed :: ConnEv
PortUnsubscribed :: ConnEv
data EmptyEv
TuneRequest :: EmptyEv
Reset :: EmptyEv
Sensing :: EmptyEv
None :: EmptyEv
Unknown :: EmptyEv
newtype Tag
Tag :: Word8 -> Tag
unTag :: Tag -> Word8
newtype Tempo
Tempo :: Int32 -> Tempo
unTempo :: Tempo -> Int32
newtype Parameter
Parameter :: Word32 -> Parameter
unParameter :: Parameter -> Word32
newtype Value
Value :: Int32 -> Value
unValue :: Value -> Int32
newtype Channel
Channel :: Word8 -> Channel
unChannel :: Channel -> Word8
newtype Pitch
Pitch :: Word8 -> Pitch
unPitch :: Pitch -> Word8
newtype Velocity
Velocity :: Word8 -> Velocity
unVelocity :: Velocity -> Word8
normalVelocity :: Velocity
offVelocity :: Velocity
newtype Duration
Duration :: Word32 -> Duration
unDuration :: Duration -> Word32
module Sound.ALSA.Sequencer.Event.Accessor
highPriority :: T T Bool
tag :: T T Tag
queue :: T T T
time :: T T T
timeStamp :: T T Stamp
source :: T T T
dest :: T T T
connect :: T T T
body :: T T Data
-- | This module allows to cancel events according to some criteria. In all
-- cases other than setInput and setOutput the criteria are
-- combined by logical AND. For every criterion we provide three kinds of
-- accessors:
--
--