midi-0.0.5: Handling of MIDI messages and filesSource codeContentsIndex
Sound.MIDI.Event
Description

Datatype for MIDI events as they can be sent to a synthesizer. That is, no timing is handled here.

Taken from Haskore.

Synopsis
data T
= NoteOff Pitch Velocity
| NoteOn Pitch Velocity
| PolyAfter Pitch Pressure
| ProgramChange Program
| Control Controller ControllerValue
| PitchBend PitchBendRange
| MonoAfter Pressure
data Pitch
data Program
data Channel
data Controller
= BankSelectMSB
| ModulationMSB
| BreathControlMSB
| Controller03
| FootControlMSB
| PortamentoTimeMSB
| DataEntryMSB
| MainVolumeMSB
| BalanceMSB
| Controller09
| PanoramaMSB
| ExpressionMSB
| Controller0C
| Controller0D
| Controller0E
| Controller0F
| GeneralPurpose1MSB
| GeneralPurpose2MSB
| GeneralPurpose3MSB
| GeneralPurpose4MSB
| Controller14
| Controller15
| Controller16
| Controller17
| Controller18
| Controller19
| Controller1A
| Controller1B
| Controller1C
| Controller1D
| Controller1E
| Controller1F
| BankSelectLSB
| ModulationLSB
| BreathControlLSB
| Controller23
| FootControlLSB
| PortamentoTimeLSB
| DataEntryLSB
| MainVolumeLSB
| BalanceLSB
| Controller29
| PanoramaLSB
| ExpressionLSB
| Controller2C
| Controller2D
| Controller2E
| Controller2F
| GeneralPurpose1LSB
| GeneralPurpose2LSB
| GeneralPurpose3LSB
| GeneralPurpose4LSB
| Controller34
| Controller35
| Controller36
| Controller37
| Controller38
| Controller39
| Controller3A
| Controller3B
| Controller3C
| Controller3D
| Controller3E
| Controller3F
| Sustain
| Porta
| Sustenuto
| SoftPedal
| Controller44
| Hold2
| Controller46
| Controller47
| Controller48
| Controller49
| Controller4A
| Controller4B
| Controller4C
| Controller4D
| Controller4E
| Controller4F
| GeneralPurpose5
| GeneralPurpose6
| GeneralPurpose7
| GeneralPurpose8
| Controller54
| Controller55
| Controller56
| Controller57
| Controller58
| Controller59
| Controller5A
| ExtDepth
| TremoloDepth
| ChorusDepth
| CelesteDepth
| PhaserDepth
| DataIncrement
| DataDecrement
| NonRegisteredParameterLSB
| NonRegisteredParameterMSB
| RegisteredParameterLSB
| RegisteredParameterMSB
| Controller66
| Controller67
| Controller68
| Controller69
| Controller6A
| Controller6B
| Controller6C
| Controller6D
| Controller6E
| Controller6F
| Controller70
| Controller71
| Controller72
| Controller73
| Controller74
| Controller75
| Controller76
| Controller77
| Controller78
| Controller79
| Controller7A
| Controller7B
| Controller7C
| Controller7D
| Controller7E
| Controller7F
type ControllerValue = Int
type PitchBendRange = Int
type Pressure = Int
data Velocity
isNote :: T -> Bool
isNoteOn :: T -> Bool
isNoteOff :: T -> Bool
zeroKey :: Pitch
maximumVelocity :: Num quant => quant
toFloatVelocity :: (Integral a, Fractional b) => a -> b
toFloatController :: (Integral a, Fractional b) => a -> b
modulation :: Controller
fromPitch :: Pitch -> Int
toPitch :: Int -> Pitch
fromVelocity :: Velocity -> Int
toVelocity :: Int -> Velocity
fromProgram :: Program -> Int
toProgram :: Int -> Program
fromChannel :: Channel -> Int
toChannel :: Int -> Channel
increasePitch :: Int -> Pitch -> Pitch
subtractPitch :: Pitch -> Pitch -> Int
Documentation
data T Source
Constructors
NoteOff Pitch Velocity
NoteOn Pitch Velocity
PolyAfter Pitch Pressure
ProgramChange Program
Control Controller ControllerValue
PitchBend PitchBendRange
MonoAfter Pressure
show/hide Instances
data Pitch Source
show/hide Instances
data Program Source
show/hide Instances
data Channel Source
show/hide Instances
data Controller Source
Types of predefined MIDI controllers.
Constructors
BankSelectMSB
ModulationMSB
BreathControlMSB
Controller03
FootControlMSB
PortamentoTimeMSB
DataEntryMSB
MainVolumeMSB
BalanceMSB
Controller09
PanoramaMSB
ExpressionMSB
Controller0C
Controller0D
Controller0E
Controller0F
GeneralPurpose1MSB
GeneralPurpose2MSB
GeneralPurpose3MSB
GeneralPurpose4MSB
Controller14
Controller15
Controller16
Controller17
Controller18
Controller19
Controller1A
Controller1B
Controller1C
Controller1D
Controller1E
Controller1F
BankSelectLSB
ModulationLSB
BreathControlLSB
Controller23
FootControlLSB
PortamentoTimeLSB
DataEntryLSB
MainVolumeLSB
BalanceLSB
Controller29
PanoramaLSB
ExpressionLSB
Controller2C
Controller2D
Controller2E
Controller2F
GeneralPurpose1LSB
GeneralPurpose2LSB
GeneralPurpose3LSB
GeneralPurpose4LSB
Controller34
Controller35
Controller36
Controller37
Controller38
Controller39
Controller3A
Controller3B
Controller3C
Controller3D
Controller3E
Controller3F
Sustain
Porta
Sustenuto
SoftPedal
Controller44
Hold2
Controller46
Controller47
Controller48
Controller49
Controller4A
Controller4B
Controller4C
Controller4D
Controller4E
Controller4F
GeneralPurpose5
GeneralPurpose6
GeneralPurpose7
GeneralPurpose8
Controller54
Controller55
Controller56
Controller57
Controller58
Controller59
Controller5A
ExtDepth
TremoloDepth
ChorusDepth
CelesteDepth
PhaserDepth
DataIncrement
DataDecrement
NonRegisteredParameterLSB
NonRegisteredParameterMSB
RegisteredParameterLSB
RegisteredParameterMSB
Controller66
Controller67
Controller68
Controller69
Controller6A
Controller6B
Controller6C
Controller6D
Controller6E
Controller6F
Controller70
Controller71
Controller72
Controller73
Controller74
Controller75
Controller76
Controller77
Controller78
Controller79
Controller7A
Controller7B
Controller7C
Controller7D
Controller7E
Controller7F
show/hide Instances
type ControllerValue = IntSource
type PitchBendRange = IntSource
type Pressure = IntSource
data Velocity Source
show/hide Instances
isNote :: T -> BoolSource
isNoteOn :: T -> BoolSource
isNoteOff :: T -> BoolSource
zeroKey :: PitchSource
A MIDI problem is that one cannot uniquely map a MIDI key to a frequency. The frequency depends on the instrument. I don't know if the deviations are defined for General MIDI. If this applies one could add transposition information to the use patch map. For now I have chosen a value that leads to the right frequency for some piano sound in my setup.
maximumVelocity :: Num quant => quantSource
The velocity of an ordinary key stroke and the maximum possible velocity.
toFloatVelocity :: (Integral a, Fractional b) => a -> bSource
64 is given as default value by the MIDI specification and thus we map it to 1.
toFloatController :: (Integral a, Fractional b) => a -> bSource
modulation :: ControllerSource
fromPitch :: Pitch -> IntSource
toPitch :: Int -> PitchSource
fromVelocity :: Velocity -> IntSource
toVelocity :: Int -> VelocitySource
fromProgram :: Program -> IntSource
toProgram :: Int -> ProgramSource
fromChannel :: Channel -> IntSource
toChannel :: Int -> ChannelSource
increasePitch :: Int -> Pitch -> PitchSource
subtractPitch :: Pitch -> Pitch -> IntSource
Produced by Haddock version 2.3.0