midi-0.2.2.2: Handling of MIDI messages and files

Safe HaskellSafe
LanguageHaskell2010

Sound.MIDI.Message.Channel

Description

Channel messages

Synopsis

Documentation

data T #

Constructors

Cons 

Instances

Eq T # 

Methods

(==) :: T -> T -> Bool #

(/=) :: T -> T -> Bool #

Ord T # 

Methods

compare :: T -> T -> Ordering #

(<) :: T -> T -> Bool #

(<=) :: T -> T -> Bool #

(>) :: T -> T -> Bool #

(>=) :: T -> T -> Bool #

max :: T -> T -> T #

min :: T -> T -> T #

Show T # 

Methods

showsPrec :: Int -> T -> ShowS #

show :: T -> String #

showList :: [T] -> ShowS #

Arbitrary T # 

Methods

arbitrary :: Gen T #

shrink :: T -> [T] #

C T # 
C T # 
C T # 

data Body #

Constructors

Voice T 
Mode T 

Instances

Eq Body # 

Methods

(==) :: Body -> Body -> Bool #

(/=) :: Body -> Body -> Bool #

Ord Body # 

Methods

compare :: Body -> Body -> Ordering #

(<) :: Body -> Body -> Bool #

(<=) :: Body -> Body -> Bool #

(>) :: Body -> Body -> Bool #

(>=) :: Body -> Body -> Bool #

max :: Body -> Body -> Body #

min :: Body -> Body -> Body #

Show Body # 

Methods

showsPrec :: Int -> Body -> ShowS #

show :: Body -> String #

showList :: [Body] -> ShowS #

get :: C parser => Int -> Channel -> Int -> Fragile parser T #

Parse a MIDI Channel message. Note that since getting the first byte is a little complex (there are issues with running status), the code, channel and first data byte must be determined by the caller.

getWithStatus :: C parser => Int -> Fragile (T parser) T #

Parse an event. Note that in the case of a regular MIDI Event, the tag is the status, and we read the first byte of data before we call get. In the case of a MIDIEvent with running status, we find out the status from the parser (it's been nice enough to keep track of it for us), and the tag that we've already gotten is the first byte of data.

put :: C writer => T -> writer #

putWithStatus :: (Compression compress, C writer) => T -> T compress writer #

data Pitch #

Instances

Bounded Pitch # 
Enum Pitch # 
Eq Pitch # 

Methods

(==) :: Pitch -> Pitch -> Bool #

(/=) :: Pitch -> Pitch -> Bool #

Ord Pitch # 

Methods

compare :: Pitch -> Pitch -> Ordering #

(<) :: Pitch -> Pitch -> Bool #

(<=) :: Pitch -> Pitch -> Bool #

(>) :: Pitch -> Pitch -> Bool #

(>=) :: Pitch -> Pitch -> Bool #

max :: Pitch -> Pitch -> Pitch #

min :: Pitch -> Pitch -> Pitch #

Show Pitch # 

Methods

showsPrec :: Int -> Pitch -> ShowS #

show :: Pitch -> String #

showList :: [Pitch] -> ShowS #

Ix Pitch # 
Arbitrary Pitch # 

Methods

arbitrary :: Gen Pitch #

shrink :: Pitch -> [Pitch] #

Random Pitch # 

Methods

randomR :: RandomGen g => (Pitch, Pitch) -> g -> (Pitch, g) #

random :: RandomGen g => g -> (Pitch, g) #

randomRs :: RandomGen g => (Pitch, Pitch) -> g -> [Pitch] #

randoms :: RandomGen g => g -> [Pitch] #

randomRIO :: (Pitch, Pitch) -> IO Pitch #

randomIO :: IO Pitch #

data Velocity #

Instances

Bounded Velocity #

ToDo: We have defined minBound = Velocity 0, but strictly spoken the minimum Velocity is 1, since Velocity zero means NoteOff. One can at least think of NoteOff with (Velocity 0), but I have never seen that.

Eq Velocity # 
Ord Velocity # 
Show Velocity # 
Arbitrary Velocity # 
Random Velocity # 

data Program #

Instances

Bounded Program # 
Enum Program # 
Eq Program # 

Methods

(==) :: Program -> Program -> Bool #

(/=) :: Program -> Program -> Bool #

Ord Program # 
Show Program # 
Ix Program # 
Arbitrary Program # 
Random Program # 

Methods

randomR :: RandomGen g => (Program, Program) -> g -> (Program, g) #

random :: RandomGen g => g -> (Program, g) #

randomRs :: RandomGen g => (Program, Program) -> g -> [Program] #

randoms :: RandomGen g => g -> [Program] #

randomRIO :: (Program, Program) -> IO Program #

randomIO :: IO Program #

data Controller #

We do not define Controller as enumeration with many constructors, because some controllers have multiple names and some are undefined. It is also more efficient this way. Thus you cannot use case for processing controller types, but you can use lookup instead.

maybe (putStrLn "unsupported controller") putStrLn $
lookup ctrl $
   (portamento, "portamento") :
   (modulation, "modulation") :
   []

Instances

Bounded Controller # 
Enum Controller # 
Eq Controller # 
Ord Controller # 
Show Controller # 
Ix Controller # 
Arbitrary Controller # 
Random Controller # 

decodeStatus :: Int -> (Int, Channel) #

for internal use