midi-0.2.0.1: Handling of MIDI messages and files

Safe Haskell | None

Sound.MIDI.Message.Class.Query

Synopsis

- class C event where
  - note :: event -> Maybe (Channel, (Velocity, Pitch, Bool))
  - program :: event -> Maybe (Channel, Program)
  - anyController :: event -> Maybe (Channel, (Controller, Int))
  - pitchBend :: event -> Maybe (Channel, Int)
  - channelPressure :: event -> Maybe (Channel, Int)
  - mode :: event -> Maybe (Channel, T)
- liftMidi :: (T -> Maybe (Channel, a)) -> T -> Maybe (Channel, a)

# Documentation

class C event where Source

All methods have default implementations that return `Nothing`. This helps implementing event data types that support only a subset of types of events.

Maybe a better approach is to provide type classes for every type of event and make `C` a subclass of all of them.

Methods

note :: event -> Maybe (Channel, (Velocity, Pitch, Bool))Source

program :: event -> Maybe (Channel, Program)Source

anyController :: event -> Maybe (Channel, (Controller, Int))Source

pitchBend :: event -> Maybe (Channel, Int)Source

channelPressure :: event -> Maybe (Channel, Int)Source

mode :: event -> Maybe (Channel, T)Source

Instances

C T |
C T |

liftMidi :: (T -> Maybe (Channel, a)) -> T -> Maybe (Channel, a)Source