def Port(port): """ Port(port) Change the event's port number. """ return _Unit(_mididings.Port(_util.actual(port)))
def Key(note): """ Key(note) Change note events to a fixed note number. """ return _Unit(_mididings.Key(note))
def Channel(channel): """ Channel(channel) Change the event's channel number. """ return _Unit(_mididings.Channel(_util.actual(channel)))
def CtrlMap(ctrl_in, ctrl_out): """ CtrlMap(ctrl_in, ctrl_out) Convert controller *ctrl_in* to *ctrl_out*, i.e. change the event's control change number. """ return _Unit(_mididings.CtrlMap(ctrl_in, ctrl_out))
def Sanitize(): """ Sanitize() Make sure the event is a valid MIDI message. Events with invalid port (output), channel, controller, program or note number are discarded. Note velocity and controller values are confined to the range 0-127. """ return _Unit(_mididings.Sanitize())
def SysEx(port, sysex): """ SysEx(sysex) SysEx(port, sysex) Create a system exclusive event, replacing the incoming event. *sysex* can be a string (binary or ASCII) or a sequence of integers, and must include the leading ``F0`` and trailing ``F7`` bytes. """ return _Unit(_mididings.SysExGenerator( _util.actual_ref(port), sysex, ))
def Ctrl(port, channel, ctrl, value): """ Ctrl(ctrl, value) Ctrl(port, channel, ctrl, value) Create a control change event, replacing the incoming event. """ return _Unit(_mididings.Generator( _constants.CTRL, _util.actual_ref(port), _util.actual_ref(channel), ctrl, value ))
def NoteOff(port, channel, note, velocity=0): """ NoteOff(note, velocity=0) NoteOff(port, channel, note, velocity=0) Create a note-off event, replacing the incoming event. """ return _Unit(_mididings.Generator( _constants.NOTEOFF, _util.actual_ref(port), _util.actual_ref(channel), note, velocity ))
def Program(port, channel, program): """ Program(program) Program(port, channel, program) Create a program change event, replacing the incoming event. """ return _Unit(_mididings.Generator( _constants.PROGRAM, _util.actual_ref(port), _util.actual_ref(channel), 0, _util.actual_ref(program) ))
def PolyAftertouch(port, channel, note, value): """ PolyAftertouch(note, value) PolyAftertouch(port, channel, note, value) Create a polyphonic aftertouch event, replacing the incoming event. """ return _Unit(_mididings.Generator( _constants.POLY_AFTERTOUCH, _util.actual_ref(port), _util.actual_ref(channel), note, value ))
def Aftertouch(port, channel, value): """ Aftertouch(value) Aftertouch(port, channel, value) Create an aftertouch event, replacing the incoming event. """ return _Unit(_mididings.Generator( _constants.AFTERTOUCH, _util.actual_ref(port), _util.actual_ref(channel), 0, value ))
def Pitchbend(port, channel, value): """ Pitchbend(value) Pitchbend(port, channel, value) Create a pitch-bend event, replacing the incoming event. """ return _Unit(_mididings.Generator( _constants.PITCHBEND, _util.actual_ref(port), _util.actual_ref(channel), 0, value ))
def Generator(type, port=_constants.EVENT_PORT, channel=_constants.EVENT_CHANNEL, data1=0, data2=0): """ Generator(type, port, channel, data1=0, data2=0) Generic generator to change the incoming event's type and data. System common and system realtime events can only be created this way. """ return _Unit(_mididings.Generator( type, _util.actual_ref(port), _util.actual_ref(channel), data1, data2 ))
def CtrlRange(ctrl, min, max, in_min=0, in_max=127): """ CtrlRange(ctrl, min, max, in_min=0, in_max=127) Linearly map control change values for controller *ctrl* from the interval [*in_min*, *in_max*] to the interval [*min*, *max*]. Any input value less than or equal to *in_min* results in an output value of *min*. Likewise, any value of *in_max* or greater results in an output value of *max*. """ if in_min > in_max: # swap ranges so that in_min is less than in_max in_min, in_max = in_max, in_min min, max = max, min return _Unit(_mididings.CtrlRange(ctrl, min, max, in_min, in_max))
def Velocity(offset): return _Unit(_mididings.Velocity( offset, _mididings.TransformMode.OFFSET))
def VelocitySlope(notes, curve): _check_velocity_slope(notes, curve) return _Unit(_mididings.VelocitySlope( notes, curve, _mididings.TransformMode.CURVE))
def CtrlCurve(ctrl, curve): return _Unit(_mididings.CtrlCurve( ctrl, curve, _mididings.TransformMode.CURVE))
def VelocitySlope(notes, gamma): _check_velocity_slope(notes, gamma) return _Unit(_mididings.VelocitySlope( notes, gamma, _mididings.TransformMode.GAMMA))
def VelocitySlope(notes, fixed): _check_velocity_slope(notes, fixed) return _Unit(_mididings.VelocitySlope( notes, fixed, _mididings.TransformMode.FIXED))
def VelocitySlope(notes, multiply): _check_velocity_slope(notes, multiply) return _Unit(_mididings.VelocitySlope( notes, multiply, _mididings.TransformMode.MULTIPLY))
def VelocitySlope(notes, offset): _check_velocity_slope(notes, offset) return _Unit(_mididings.VelocitySlope( notes, offset, _mididings.TransformMode.OFFSET))
def CtrlCurve(ctrl, multiply): return _Unit(_mididings.CtrlCurve( ctrl, multiply, _mididings.TransformMode.MULTIPLY))
def CtrlCurve(ctrl, gamma): return _Unit(_mididings.CtrlCurve( ctrl, gamma, _mididings.TransformMode.GAMMA))
def Velocity(multiply): return _Unit(_mididings.Velocity( multiply, _mididings.TransformMode.MULTIPLY))
def CtrlCurve(ctrl, offset): return _Unit(_mididings.CtrlCurve( ctrl, offset, _mididings.TransformMode.OFFSET))
def Velocity(fixed): return _Unit(_mididings.Velocity( fixed, _mididings.TransformMode.FIXED))
def PitchbendRange(min, max, in_min=-8192, in_max=8191): return _Unit(_mididings.PitchbendRange(min, max, in_min, in_max))
def Velocity(gamma): return _Unit(_mididings.Velocity( gamma, _mididings.TransformMode.GAMMA))
def Transpose(offset): return _Unit(_mididings.Transpose(offset))
def Velocity(curve): return _Unit(_mididings.Velocity( curve, _mididings.TransformMode.CURVE))