midi-0.2.1.3: Handling of MIDI messages and files

Safe HaskellSafe-Inferred

Sound.MIDI.Message.Class.Check

Synopsis

Documentation

class C event whereSource

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

Warning: This returns note events as they are, that is, a NoteOff p 64 might be encoded as such or as NoteOn p 0 depending on the content of event. For normalized results you may use noteExplicitOff.

program :: Channel -> event -> Maybe ProgramSource

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

pitchBend :: Channel -> event -> Maybe IntSource

channelPressure :: Channel -> event -> Maybe IntSource

mode :: Channel -> event -> Maybe TSource

Instances

C T 
C T 

noteExplicitOff :: C event => Channel -> event -> Maybe (Velocity, Pitch, Bool)Source

Like note, but converts NoteOn p 0 to NoteOff p 64. See explicitNoteOff.

noteImplicitOff :: C event => Channel -> event -> Maybe (Velocity, Pitch, Bool)Source

Like note, but converts NoteOff p 64 to NoteOn p 0. See implicitNoteOff.

controller :: C event => Channel -> Controller -> event -> Maybe IntSource

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