scholar of all things neologistic
Requirements:
Any patch using Max/pk must have a single instance of pk_base, which is responsible for interpreting all sysex commands from the padKONTROL. In order to use the rest of the library's functionality, you must put your padKONTROL into 'Native Mode'; you can use the pk_set_native_mode patcher to do so.Functional modules:
pk_arg_enabler - pk_calc_trigger_column - pk_calc_trigger_column_row - pk_calc_trigger_row - pk_calc_trigger_row_column - pk_ctrl - pk_display - pk_get_key_name - pk_get_pad_id - pk_get_pad_ids - pk_gate_enabler - pk_input - pk_input_on - pk_input_off - pk_input_knob - pk_input_pad - pk_input_pad_on - pk_input_pad_off - pk_input_rotary - pk_input_trigger - pk_input_trigger_on - pk_input_trigger_off - pk_invert_16_vertical - pk_led_blink - pk_led_flash - pk_led_on - pk_led_off - pk_led_stateBase modules
pk_base
Inputs sysex commands sent by the padKONTROL, removes superfluous data, and sends as messages to all other patches.
- symbol [a-g], representing the MIDI device used to input sysex commands from the padKONTROL
pk_set_native_mode
Activates native mode when '1' is received via inlet; deactivates if '0' is received
- Boolean (1 or 0)
Interface modules
pk_group_select
Sets up the given pads as a select group. Any pad in the group that is depressed will be 'selected', causing its LED to light up and its name symbol to be sent out the outlet. The previously lit pad will be darkened, so that only one pad appears to be 'selected' at a time.
A list of pad names
pk_group_select_rotrary
Sets up the given pads as a select group (see pk_group_select), with each pad 'owning' a rotary value. Any time one of the pads is seleced, its current rotary value will be displayed on the LCD and can be modified by turning the rotary dial. In this way, several rotary values can be maintained and switched through by using the select group. Any time a new pad is seleced or rotary dial turned, it will output a list with the pad symbol as the first element and the current rotary value as the second element.
A list of pad names
pk_hold_select
Sets up one pad (specified in argument) to show and activate a select group (specified with 'group' message) when held. When the main pad is depressed, the currently selected pad will be lit up, and any other pad within the group can be selected while the main pad is still being depressed. Outputs the currently selected pad when the main pad is depressed, and then any newly selected pad.
The pad which activates the select group
- Allows 'enable' and 'disable' messages to activate/deactivate the select; a 'group' message followed by a list of pad names sets which pads will be used as the select.
Functional modules
pk_arg_enabler
When any message is received via inlet, it is matched against the argument; an 'enable' message is sent out if there is a match, 'disable' if not.
pk_calc_trigger_column
Outputs the column number (1-4) of the trigger pad number sent through the inlet (e.g., column
- Integer corresponding to a trigger pad (1-16)
pk_calc_trigger_column_row
Outputs a list of two numbers (each 1-4), the first being the column of trigger pad number sent through the inlet, the second being the row (e.g., '2 4' for pad
- Integer corresponding to a trigger pad (1-16)
pk_calc_trigger_row
Outputs the row number (1-4) of the trigger pad number sent through the inlet (e.g., row
- Integer corresponding to a trigger pad (1-16)
pk_calc_trigger_row_column
Outputs a list of two numbers (each 1-4), the first being the row of trigger pad number sent through the inlet, the second being the column (e.g., '4 2' for pad
- Integer corresponding to a trigger pad (1-16)
pk_ctrl
Prepends necessary sysex details to a list of integers and sends to the padKONTROL (currently designated solely as MIDI output 'p', though in the future this will be configurable.)
- A list of integers to be sent as sysex to the padKONTROL
pk_display
On input, displays the supplied characters on the padKONTROL LCD
- A list of up to three characters
pk_get_key_name
Outputs the name of the corresponding key
- A single integer representing a padKONTROL key
pk_get_pad_id
Outputs the integer ID of the corresponding trigger or key
- A single integer (corresponding to a trigger pad) or the symbol name of a padKONTROL key
pk_get_pad_ids
Outputs a single integer ID if a pad is specified; if a group is specified, outputs a list of all its pad IDs
- A single integer (corresponding to a trigger pad), symbol name of a padKONTROL key, or symbol name of a group of padKONTROL keys
pk_gate_enabler
Gates inlets two, three, and four to their corresponding outlets based on whether the most recent message in the first inlet was 'enable' or 'disable'. Also outputs enablement messages through the first outlet when received.
- (First) 'enable' or 'disable' message
- (Two - Four) Input routed directly to corresponding outlets when enabled
pk_input
Each time a key is depressed/released, outputs a list containing the key name and on/off value (1 or 0)
pk_input_on
Each time a key is depressed, outputs the key name
pk_input_off
Each time a key is released, outputs the key name
pk_input_knob
Each time a knob is turned, outputs a list containing the knob name (knob1 or knob2) and the value
pk_input_pad
Each time any key or trigger is depressed/released, outputs a list containing the key/trigger name, on/off value (1 or 0), and velocity (if a trigger)
pk_input_pad_on
Each time any key or trigger is depressed, outputs the key/trigger name and velocity (if a trigger)
pk_input_pad_off
Each time any key or trigger is released, outputs the key/trigger name
pk_input_rotary
Any time the rotary dial is turned, outputs a increment/decrement value (-1 if turned left, 1 if turned right)
pk_input_trigger
Each time a trigger is depressed/released, outputs a list containing the trigger number, on/off value (1 or 0), and velocity
pk_input_trigger_on
Each time a trigger is depressed, outputs a list containing the trigger number and velocity
pk_input_trigger_off
Each time a trigger is released, outputs the trigger name
pk_invert_16_vertical
Outputs a number (1-16) that corresponds to the specified pad when reversed horizontally (e.g., pad
- Integer corresponding to a trigger pad
pk_led_flash
Briefly flashes the specified pad(s) LED(s). The LED will be returned to whatever status it was before once flashed.
- Pad or pad group name
pk_led_state
Sets the state of the specified pad(s) LED(s) to the value designated in the argument
Integer state that any pad(s) LED(s) should be set to
- Pad or pad group name