Safe Haskell | Safe-Inferred |
---|
Support for MIDI controls.
Synopsis
- type ControlMap = Map ScoreT.Control Midi.Control
- control_map :: [(Midi.Control, ScoreT.Control)] -> ControlMap
- empty_map :: ControlMap
- type PbRange = (Int, Int)
- control_constructor :: ControlMap -> ScoreT.Control -> Midi.Key -> Maybe (Signal.Y -> Midi.ChannelMessage)
- is_midi_control :: ControlMap -> ScoreT.Control -> Bool
- is_channel_control :: ScoreT.Control -> Bool
- pitch_to_midi :: PbRange -> Pitch.NoteNumber -> Maybe (Midi.Key, Midi.PitchBendValue)
- pb_from_nn :: PbRange -> Midi.Key -> Pitch.NoteNumber -> Midi.PitchBendValue
- universal_control_map :: ControlMap
- cc_to_control :: Midi.Control -> ScoreT.Control
- val_to_pb :: Signal.Y -> Int
- val_to_cval :: Signal.Y -> Midi.ControlValue
- cval_to_val :: Midi.ControlValue -> Signal.Y
Documentation
type ControlMap = Map ScoreT.Control Midi.Control Source #
control_map :: [(Midi.Control, ScoreT.Control)] -> ControlMap Source #
type PbRange = (Int, Int) Source #
Pitchbend range in tempered semitones below and above unity. The first integer should probably be negative.
control_constructor :: ControlMap -> ScoreT.Control -> Midi.Key -> Maybe (Signal.Y -> Midi.ChannelMessage) Source #
Convert from a control to a function that creates its MIDI message.
is_midi_control :: ControlMap -> ScoreT.Control -> Bool Source #
True if the given control will be used by the MIDI performer.
Takes a ScoreT.Control because being a MIDI control is a precondition for
conversion into Control
.
is_channel_control :: ScoreT.Control -> Bool Source #
True for controls that must have a channel to themselves. Midi controls are a subset of what I consider controls, since I include all variable note parameters.
pitch_to_midi :: PbRange -> Pitch.NoteNumber -> Maybe (Midi.Key, Midi.PitchBendValue) Source #
Given a NoteNumber, return the midi note number and pitch bend amount to sound at the pitch.
pb_from_nn :: PbRange -> Midi.Key -> Pitch.NoteNumber -> Midi.PitchBendValue Source #
cc controls
universal_control_map :: ControlMap Source #
This map is used by both input and outpt. On input, InputNote maps a midi cc to a symbolic control name, and on output, maps it back again. Of course it may very well be mapped to and from a higher level control name but the defaults are always available.
On output, the "standard" set of symbolic names are understood, but the low level cc## names work uniformly.
This will also be checked by control_constructor
, so these are controls
that every instrument will respond to. Of course it may override some of
these names if it wishes.