alsa-midi-0.3.1: Bindings for the ALSA sequencer API (MIDI stuff)ContentsIndex
Sound.ALSA.SequencerFFI
Contents
FFI stuff
Error handling
Sequencer
Port
Queue
Tempo
Utility functions
Synopsis
newtype T = Cons Ptr ()
data EventDataUnion
= DataUnknown CUInt CUInt CUInt
| Note {
noteChannel :: CUChar
notePitch :: CUChar
noteVelocity :: CUChar
noteOffVelocity :: CUChar
noteDuration :: CUInt
}
| Control {
controlChannel :: CUChar
controlParameter :: CUInt
controlValue :: CInt
}
| QueueEv {
queueId :: Queue
queueControl :: QueueControl
}
| Connect {
connectSender :: Address
connectDest :: Address
}
| Fixed
isConnect :: EventDataUnion -> Bool
isFixed :: EventDataUnion -> Bool
isNote :: EventDataUnion -> Bool
isController :: EventDataUnion -> Bool
peekEventData :: Ptr EventDataUnion -> EventType -> IO EventDataUnion
peekConnect :: Ptr EventDataUnion -> IO EventDataUnion
peekNote :: Ptr EventDataUnion -> IO EventDataUnion
peekControl :: Ptr EventDataUnion -> IO EventDataUnion
pokeEventData :: Ptr EventDataUnion -> EventDataUnion -> IO ()
class TimeValue a
data RealTime = RealTime {
tv_sec :: CUInt
tv_nsec :: CUInt
}
newtype TickTime = TickTime {
tv_ticks :: CUInt
}
data TimeUnit
= TimeUnitReal
| TimeUnitTick
data TimeMode
= TimeModeAbsolute
| TimeModeRelative
data TimeStamp
= TimeStampTick TickTime
| TimeStampReal RealTime
peekTimeStamp :: TimeUnit -> Ptr TimeStamp -> IO TimeStamp
pokeTimeStamp :: Ptr TimeStamp -> TimeStamp -> IO TimeUnit
newtype ClientId = ClientId CUInt
clientSystem :: ClientId
clientDummy :: ClientId
clientOSS :: ClientId
newtype Port = Port CUInt
portSystemTimer :: Port
portSystemAnnounce :: Port
data Address = Address {
client :: ClientId
port :: Port
}
addressTimer :: Address
newtype Queue = Queue CUInt
queueDirect :: Queue
data QueueControl
= QueueControlValue CInt
| QueueControlTime TimeStamp
| QueueControlPosition CUInt
| QueueControlData32 CUInt CUInt
| QueueControlData8 CUChar CUChar CUChar CUChar CUChar CUChar CUChar CUChar
pokeQueueControl :: Ptr QueueControl -> QueueControl -> IO ()
data EventType
= EventSystem
| EventResult
| EventPad002
| EventPad003
| EventPad004
| EventNote
| EventNoteOn
| EventNoteOff
| EventKeyPressure
| EventPad009
| EventController
| EventProgramChange
| EventChannelPressure
| EventPitchbend
| EventControl14
| EventNonRegisteredParameter
| EventRegisteredParameter
| EventPad017
| EventPad018
| EventPad019
| EventSongPosition
| EventSongSelect
| EventQuarterFrame
| EventTimeSign
| EventKeySign
| EventPad025
| EventPad026
| EventPad027
| EventPad028
| EventPad029
| EventStart
| EventContinue
| EventStop
| EventSetPositionTick
| EventSetPositionTime
| EventTempo
| EventClock
| EventTick
| EventQueueSkew
| EventSyncPos
| EventTuneRequest
| EventReset
| EventSensing
| EventPad043
| EventPad044
| EventPad045
| EventPad046
| EventPad047
| EventPad048
| EventPad049
| EventEcho
| EventOSS
| EventPad052
| EventPad053
| EventPad054
| EventPad055
| EventPad056
| EventPad057
| EventPad058
| EventPad059
| EventClientStart
| EventClientExit
| EventClientChange
| EventPortStart
| EventPortExit
| EventPortChange
| EventPortSubscribed
| EventPortUnsubscribed
| EventPad068
| EventPad069
| EventSample
| EventSampleCluster
| EventSampleStart
| EventSampleStop
| EventSampleFrequency
| EventSampleVolume
| EventSampleLoop
| EventSamplePosition
| EventSamplePrivate1
| EventPad079
| EventPad080
| EventPad081
| EventPad082
| EventPad083
| EventPad084
| EventPad085
| EventPad086
| EventPad087
| EventPad088
| EventPad089
| EventUser0
| EventUser1
| EventUser2
| EventUser3
| EventUser4
| EventUser5
| EventUser6
| EventUser7
| EventUser8
| EventUser9
| EventInstrumentBegin
| EventInstrumentEnd
| EventInstrumentInfo
| EventInstrumentInfoResult
| EventInstrumentFormatInfo
| EventInstrumentFormatInfoResult
| EventInstrumentReset
| EventInstrumentStatus
| EventInstrumentStatusResult
| EventInstrumentPut
| EventInstrumentGet
| EventInstrumentGetResult
| EventInstrumentFree
| EventInstrumentList
| EventInstrumentListResult
| EventInstrumentCluster
| EventInstrumentClusterGet
| EventInstrumentClusterResult
| EventInstrumentChange
| EventPad119
| EventPad120
| EventPad121
| EventPad122
| EventPad123
| EventPad124
| EventPad125
| EventPad126
| EventPad127
| EventPad128
| EventPad129
| EventSystemExclusive
| EventBounce
| EventPad132
| EventPad133
| EventPad134
| EventUserVar0
| EventUserVar1
| EventUserVar2
| EventUserVar3
| EventUserVar4
data EventLength
= EventLengthFixed
| EventLengthVariable
| EventLengthVariableUser
data Priority
= PriorityNormal
| PriorityHigh
data Event = Event {
typ :: EventType
tag :: CUChar
queue :: Queue
time :: TimeStamp
timeMode :: TimeMode
eventLength :: EventLength
priority :: Priority
source :: Address
dest :: Address
eventData :: EventDataUnion
}
newtype EnumBitPos a = EnumBitPos Int
timeUnitBit :: EnumBitPos TimeUnit
timeModeBit :: EnumBitPos TimeMode
eventLengthBit :: EnumBitPos EventLength
priorityBit :: EnumBitPos Priority
newtype ReturnCode = ReturnCode CInt
check :: String -> IO ReturnCode -> IO CUInt
str_error :: CInt -> IO CString
open :: Ptr T -> CString -> OpenMode -> CUInt -> IO ReturnCode
close :: T -> IO ReturnCode
set_client_name :: T -> CString -> IO ()
client_id :: T -> ClientId
event_output :: T -> Ptr Event -> IO ReturnCode
drain_output :: T -> IO ReturnCode
event_input :: T -> Ptr (Ptr Event) -> IO ReturnCode
create_simple_port :: T -> Ptr CChar -> PortCapabilitySet -> PortTypeSet -> IO ReturnCode
delete_simple_port :: T -> Port -> IO ReturnCode
alloc_named_queue :: T -> CString -> IO ReturnCode
alloc_queue :: T -> IO ReturnCode
free_queue :: T -> Queue -> IO ReturnCode
newtype Tempo = Tempo Ptr ()
queue_tempo_malloc :: Ptr Tempo -> IO ReturnCode
queue_tempo_free :: Tempo -> IO ()
queue_tempo_set_tempo :: Tempo -> CUInt -> IO ()
queue_tempo_set_ppq :: Tempo -> CUInt -> IO ()
get_queue_tempo :: T -> Queue -> Tempo -> IO ReturnCode
set_queue_tempo :: T -> Queue -> Tempo -> IO ReturnCode
type OpenMode = FlagSet CUInt Open
data Open
= OpenOutput
| OpenInput
openOutput :: OpenMode
openInput :: OpenMode
openDuplex :: OpenMode
type PortTypeSet = FlagSet CUInt PortType
data PortType
= PortTypeSpecific
| PortTypeMIDIGeneric
| PortTypeMIDIGM
| PortTypeMIDIGS
| PortTypeMIDIXG
| PortTypeMIDIMT32
| PortType06
| PortType07
| PortType08
| PortType09
| PortTypeSynth
| PortTypeDirectSample
| PortTypeSample
| PortType13
| PortType14
| PortType15
| PortType16
| PortType17
| PortType18
| PortType19
| PortTypeApplication
portTypeMIDIGeneric :: PortTypeSet
portTypeMIDIGM :: PortTypeSet
portTypeMIDIGS :: PortTypeSet
portTypeMIDIXG :: PortTypeSet
portTypeMIDIMT32 :: PortTypeSet
portTypeSynth :: PortTypeSet
portTypeDirectSample :: PortTypeSet
portTypeSample :: PortTypeSet
portTypeApplication :: PortTypeSet
portTypeSpecific :: PortTypeSet
type PortCapabilitySet = FlagSet CUInt PortCapability
data PortCapability
= PortCapRead
| PortCapWrite
| PortCapSyncRead
| PortCapSyncWrite
| PortCapDuplex
| PortCapSubsRead
| PortCapSubsWrite
| PortCapNoExport
portCapWrite :: PortCapabilitySet
portCapSyncRead :: PortCapabilitySet
portCapSyncWrite :: PortCapabilitySet
portCapDuplex :: PortCapabilitySet
portCapSubsRead :: PortCapabilitySet
portCapSubsWrite :: PortCapabilitySet
portCapNoExport :: PortCapabilitySet
portCapRead :: PortCapabilitySet
select :: a -> [(Bool, a)] -> a
newtype FlagSet word enum = FlagSet {
unFlagSet :: word
}
flagToWord :: (Enum a, Bits w) => a -> FlagSet w a
flagsToWord :: (Enum a, Bits w) => [a] -> FlagSet w a
wordToFlags :: (Enum a, Bits w) => FlagSet w a -> [a]
intToFlags :: (Enum a, Integral w) => FlagSet w a -> [a]
unpackEnum :: (Enum a, Integral b, Bits b) => b -> EnumBitPos a -> b -> a
packEnum :: (Bits b, Enum a) => EnumBitPos a -> a -> b
enumToChar :: Enum a => a -> CUChar
enumFromChar :: Enum a => CUChar -> a
Documentation
newtype T
Constructors
Cons Ptr ()
show/hide Instances
data EventDataUnion
Constructors
DataUnknown CUInt CUInt CUInt
Note
noteChannel :: CUChar
notePitch :: CUChar
noteVelocity :: CUChar
noteOffVelocity :: CUChar
noteDuration :: CUInt
Control
controlChannel :: CUChar
controlParameter :: CUInt
controlValue :: CInt
QueueEv
queueId :: Queue
queueControl :: QueueControl
Connect
connectSender :: Address
connectDest :: Address
Fixed
show/hide Instances
isConnect :: EventDataUnion -> Bool
isFixed :: EventDataUnion -> Bool
isNote :: EventDataUnion -> Bool
isController :: EventDataUnion -> Bool
peekEventData :: Ptr EventDataUnion -> EventType -> IO EventDataUnion
peekConnect :: Ptr EventDataUnion -> IO EventDataUnion
peekNote :: Ptr EventDataUnion -> IO EventDataUnion
peekControl :: Ptr EventDataUnion -> IO EventDataUnion
pokeEventData :: Ptr EventDataUnion -> EventDataUnion -> IO ()
class TimeValue a
show/hide Instances
data RealTime
Constructors
RealTime
tv_sec :: CUInt
tv_nsec :: CUInt
show/hide Instances
newtype TickTime
Constructors
TickTime
tv_ticks :: CUInt
show/hide Instances
data TimeUnit
Constructors
TimeUnitReal
TimeUnitTick
show/hide Instances
data TimeMode
Constructors
TimeModeAbsolute
TimeModeRelative
show/hide Instances
data TimeStamp
Constructors
TimeStampTick TickTime
TimeStampReal RealTime
show/hide Instances
peekTimeStamp :: TimeUnit -> Ptr TimeStamp -> IO TimeStamp
pokeTimeStamp :: Ptr TimeStamp -> TimeStamp -> IO TimeUnit
newtype ClientId
Constructors
ClientId CUInt
show/hide Instances
clientSystem :: ClientId
system client
clientDummy :: ClientId
dummy ports
clientOSS :: ClientId
OSS sequencer emulator
newtype Port
Constructors
Port CUInt
show/hide Instances
portSystemTimer :: Port
system timer port
portSystemAnnounce :: Port
system announce port
data Address
Constructors
Address
client :: ClientId
port :: Port
show/hide Instances
addressTimer :: Address
newtype Queue
Constructors
Queue CUInt
show/hide Instances
queueDirect :: Queue
data QueueControl
Constructors
QueueControlValue CInt
QueueControlTime TimeStamp
QueueControlPosition CUInt
QueueControlData32 CUInt CUInt
QueueControlData8 CUChar CUChar CUChar CUChar CUChar CUChar CUChar CUChar
show/hide Instances
pokeQueueControl :: Ptr QueueControl -> QueueControl -> IO ()
data EventType
Constructors
EventSystem
EventResult
EventPad002
EventPad003
EventPad004
EventNote
EventNoteOn
EventNoteOff
EventKeyPressure
EventPad009
EventController
EventProgramChange
EventChannelPressure
EventPitchbend
EventControl14
EventNonRegisteredParameter
EventRegisteredParameter
EventPad017
EventPad018
EventPad019
EventSongPosition
EventSongSelect
EventQuarterFrame
EventTimeSign
EventKeySign
EventPad025
EventPad026
EventPad027
EventPad028
EventPad029
EventStart
EventContinue
EventStop
EventSetPositionTick
EventSetPositionTime
EventTempo
EventClock
EventTick
EventQueueSkew
EventSyncPos
EventTuneRequest
EventReset
EventSensing
EventPad043
EventPad044
EventPad045
EventPad046
EventPad047
EventPad048
EventPad049
EventEcho
EventOSS
EventPad052
EventPad053
EventPad054
EventPad055
EventPad056
EventPad057
EventPad058
EventPad059
EventClientStart
EventClientExit
EventClientChange
EventPortStart
EventPortExit
EventPortChange
EventPortSubscribed
EventPortUnsubscribed
EventPad068
EventPad069
EventSample
EventSampleCluster
EventSampleStart
EventSampleStop
EventSampleFrequency
EventSampleVolume
EventSampleLoop
EventSamplePosition
EventSamplePrivate1
EventPad079
EventPad080
EventPad081
EventPad082
EventPad083
EventPad084
EventPad085
EventPad086
EventPad087
EventPad088
EventPad089
EventUser0
EventUser1
EventUser2
EventUser3
EventUser4
EventUser5
EventUser6
EventUser7
EventUser8
EventUser9
EventInstrumentBegin
EventInstrumentEnd
EventInstrumentInfo
EventInstrumentInfoResult
EventInstrumentFormatInfo
EventInstrumentFormatInfoResult
EventInstrumentReset
EventInstrumentStatus
EventInstrumentStatusResult
EventInstrumentPut
EventInstrumentGet
EventInstrumentGetResult
EventInstrumentFree
EventInstrumentList
EventInstrumentListResult
EventInstrumentCluster
EventInstrumentClusterGet
EventInstrumentClusterResult
EventInstrumentChange
EventPad119
EventPad120
EventPad121
EventPad122
EventPad123
EventPad124
EventPad125
EventPad126
EventPad127
EventPad128
EventPad129
EventSystemExclusive
EventBounce
EventPad132
EventPad133
EventPad134
EventUserVar0
EventUserVar1
EventUserVar2
EventUserVar3
EventUserVar4
show/hide Instances
data EventLength
Constructors
EventLengthFixed
EventLengthVariable
EventLengthVariableUser
show/hide Instances
data Priority
Constructors
PriorityNormal
PriorityHigh
show/hide Instances
data Event
Constructors
Event
typ :: EventType
tag :: CUChar
queue :: Queue
time :: TimeStamp
timeMode :: TimeMode
eventLength :: EventLength
priority :: Priority
source :: Address
dest :: Address
eventData :: EventDataUnion
show/hide Instances
newtype EnumBitPos a
Constructors
EnumBitPos Int
timeUnitBit :: EnumBitPos TimeUnit
timeModeBit :: EnumBitPos TimeMode
eventLengthBit :: EnumBitPos EventLength
priorityBit :: EnumBitPos Priority
newtype ReturnCode
Constructors
ReturnCode CInt
check :: String -> IO ReturnCode -> IO CUInt
FFI stuff
Error handling
str_error :: CInt -> IO CString
should be in a more general ALSA module
Sequencer
open :: Ptr T -> CString -> OpenMode -> CUInt -> IO ReturnCode
close :: T -> IO ReturnCode
set_client_name :: T -> CString -> IO ()
client_id :: T -> ClientId
event_output :: T -> Ptr Event -> IO ReturnCode
drain_output :: T -> IO ReturnCode
event_input :: T -> Ptr (Ptr Event) -> IO ReturnCode
Port
create_simple_port :: T -> Ptr CChar -> PortCapabilitySet -> PortTypeSet -> IO ReturnCode
delete_simple_port :: T -> Port -> IO ReturnCode
Queue
alloc_named_queue :: T -> CString -> IO ReturnCode
alloc_queue :: T -> IO ReturnCode
free_queue :: T -> Queue -> IO ReturnCode
Tempo
newtype Tempo
Constructors
Tempo Ptr ()
show/hide Instances
queue_tempo_malloc :: Ptr Tempo -> IO ReturnCode
queue_tempo_free :: Tempo -> IO ()
queue_tempo_set_tempo :: Tempo -> CUInt -> IO ()
queue_tempo_set_ppq :: Tempo -> CUInt -> IO ()
get_queue_tempo :: T -> Queue -> Tempo -> IO ReturnCode
set_queue_tempo :: T -> Queue -> Tempo -> IO ReturnCode
type OpenMode = FlagSet CUInt Open
data