midi-0.2.0.1: Handling of MIDI messages and files

Safe Haskell | None

Sound.MIDI.Message.Class.Check

Synopsis

- class C event where
  - note :: Channel -> event -> Maybe (Velocity, Pitch, Bool)
  - program :: Channel -> event -> Maybe Program
  - anyController :: Channel -> event -> Maybe (Controller, Int)
  - pitchBend :: Channel -> event -> Maybe Int
  - channelPressure :: Channel -> event -> Maybe Int
  - mode :: Channel -> event -> Maybe T
- controller :: C event => Channel -> Controller -> event -> Maybe Int
- liftMidi :: (Channel -> T -> Maybe a) -> Channel -> T -> Maybe 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 :: Channel -> event -> Maybe (Velocity, Pitch, Bool)Source

program :: Channel -> event -> Maybe Program Source

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

pitchBend :: Channel -> event -> Maybe Int Source

channelPressure :: Channel -> event -> Maybe Int Source

mode :: Channel -> event -> Maybe T Source

Instances

C T |
C T |

controller :: C event => Channel -> Controller -> event -> Maybe Int Source

liftMidi :: (Channel -> T -> Maybe a) -> Channel -> T -> Maybe aSource