Units are the basic building blocks from which you can build your patches.
Filters by one or more event types.
Filters by port(s).
Filters by channel(s).
Filters by note or note-range.
Filters by note-on velocity.
Filters by CC number(s).
Filters by CC value.
Filters by PC number(s).
Filters by sysex data, specified as a string or as a sequence of integers. If sysex doesn't end with F7, partial matches that start with the given data bytes are accepted.
Filters by sysex manufacturer id, which can be a string or a sequence of integers, with a length of one or three bytes.
Splits by port.
Splits by channel.
Splits by note. Non-note events are sent to all patches.
Splits by velocity. Non-note events are sent to all patches.
Splits by controller number. Non-controller events are left unchanged, but not sent to any of the patches.
Splits by controller value. Non-controller events are left unchanged, but not sent to any of the patches.
Splits by program number. Non-program-change events are left unchanged, but not sent to any of the patches.
Splits by sysex data or manufacturer id.
Transposes all note events by the given number of semitones.
Changes note-events to a fixed note number.
Changes velocity by adding an offset, multiplying with a factor, setting it to a fixed value, or applying a velocity-curve.
gamma uses a simple power function, where values greater than 1 increase velocity, while values between 0 and 1 decrease it. curve uses a somewhat smoother exponential function, where positive values increase velocity, while negative values decrease it.
Within mididings, velocity values may be (temporarily) greater than 127 or less than 1. When sending events through a MIDI output port, or by using the Sanitize() unit, velocities greater than 127 will automatically be reduced to 127, and events with a velocity less than 1 will be removed.
Changes velocity, applying a linear slope between different notes.
This can be thought of as a Velocity() unit with different parameters for different notes, and is useful for example
to fade-in a sound over a region of the keyboard.
Both parameters must be sequences of the same length, where one velocity value corresponds to each note.
Confines velocity to values between min and max.
Maps one controller to another (i.e. changes the CC number).
Maps controller values from one range of values (default is 0-127) to another.
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.
Changes controller values by applying a curve, offset or multiplication. See Velocity() for a description of the parameters.
Changes the pitchbend range to values between min and max.
Changes the pitchbend range to the specified number of semitones.
Changes the type of the event.
If port and channel are omitted, the values of the input event are used.
To "reuse" other values from the incoming event, one of the EVENT_* constants can be used in place of any parameter.
Creates a new system exclusive event. sysex can be a string or a sequence of integers, and must include the leading F0 and trailing F7 bytes.
Generic generator. System common and system realtime events can only be generated this way.
Calls a Python function. This will stall any other MIDI processing until the function returns.
Schedules a Python function for execution, and continues MIDI processing immediately.
Like Call(), but runs the function in its own thread.
Runs an arbitrary shell command, without waiting for the command to complete.
Discards the current event.
Switches to another scene. number should be a scene number, or one of the EVENT_* constants. offset can be positive or negative and will be added to the current scene number. Without parameters, the program number of the incoming event (should be a program change) will be used.
Switches between subscenes within a scene group.
Executes patch when switching to the scene containing this unit (essentially adding it to the init-patch, see run() for more information).
Routes incoming events to the specified port/channel. Optionally, when switching to the scene containing this unit, a program change and/or arbitrary control changes can be sent. To send a bank select in addition to the program change, program can be a tuple with two elements, where the first element is the bank number, and the second is the program number.
Creates an object that when called will behave like Output(), with args and kwargs replacing some of its arguments. This works just like functools.partial(Output, *args, **kwargs), but with the added benefit that an OutputTemplate object also supports operator >> like any unit.
synth = Transpose(12) >> OutputTemplate('synth', 1, 42) patch1 = synth(64) patch2 = synth(127)
patch1 = Transpose(12) >> Output('synth', 1, 42, 64) patch2 = Transpose(12) >> Output('synth', 1, 42, 127)
Prints event data.
Prints a string. Instead of a fixed value, string can also be a Python function that takes a single MidiEvent parameter, and returns the string to be sent.
Makes sure the event is a valid MIDI message. Events with invalid port, channel, controller, program or note number are discarded, note velocity and controller values are confined to the range 0-127.