jdxi_editor.ui.windows.midi.controller_config

A window for setting up a hardware controller (an Arturia MiniLab 3 or similar) that drives the open synth editor’s filter, in the same shape as ElMo’s MIDI Control tab:

  • Connection — which ports the controller is heard on, and whether it is connected.

  • Monitor — every message arriving from it, so the CC number a knob sends can simply be read off.

  • Mappings — which CC drives which filter control, with Learn to take the number from the next knob that moves. Changes are saved to QSettings and applied to the running FilterRemote straight away, so a knob works the moment it is learnt.

  • Transport — which buttons play, pause, stop, record, rewind and fast forward the MIDI File player. Learn adds the next button pressed (a note or a CC); an action can have several, e.g. the VMX8’s note and CC modes. Saved per controller, and picked up by the player straight away.

The CC numbers a MiniLab 3 sends depend on the program loaded on the device, so the built-in map is only a starting point; Learn is the reliable way to get them right.

Attributes

STATUS_INTERVAL_MS

MONITOR_MAX_LINES

AUTOMATIC_PORTS

CONTROL_SPECS

CONTROL_LABELS

TRANSPORT_LABELS

CONTROL_SOURCES

Classes

ControlLabelSpec

How the Mappings table shows one control.

MidiControllerDialog

Set up the hardware controller that drives the filter.

Module Contents

jdxi_editor.ui.windows.midi.controller_config.STATUS_INTERVAL_MS = 1000[source]
jdxi_editor.ui.windows.midi.controller_config.MONITOR_MAX_LINES = 500[source]
jdxi_editor.ui.windows.midi.controller_config.AUTOMATIC_PORTS = 'All controller ports (automatic)'[source]
class jdxi_editor.ui.windows.midi.controller_config.ControlLabelSpec[source]

How the Mappings table shows one control.

Parameters:
  • control – FilterControl the control

  • label – str human-readable name

control: jdxi_editor.midi.io.controller_map.FilterControl[source]
label: str[source]
jdxi_editor.ui.windows.midi.controller_config.CONTROL_SPECS: list[ControlLabelSpec][source]
jdxi_editor.ui.windows.midi.controller_config.CONTROL_LABELS: Dict[jdxi_editor.midi.io.controller_map.FilterControl, str][source]
jdxi_editor.ui.windows.midi.controller_config.TRANSPORT_LABELS: Dict[jdxi_editor.midi.io.controller_map.TransportAction, str][source]
jdxi_editor.ui.windows.midi.controller_config.CONTROL_SOURCES: Dict[jdxi_editor.midi.io.controller_map.FilterControl, str][source]
class jdxi_editor.ui.windows.midi.controller_config.MidiControllerDialog(external_controller=None, filter_remote=None, parent: PySide6.QtWidgets.QWidget | None = None)[source]

Bases: PySide6.QtWidgets.QMainWindow

Set up the hardware controller that drives the filter.

preset_combo: PySide6.QtWidgets.QComboBox | None = None[source]
port_combo: PySide6.QtWidgets.QComboBox | None = None[source]
external_controller = None[source]
filter_remote = None[source]
profile: jdxi_editor.midi.io.controller_map.ControllerProfile[source]
cc_map: Dict[int, jdxi_editor.midi.io.controller_map.FilterControl][source]
_learning: jdxi_editor.midi.io.controller_map.FilterControl | None = None[source]
transport_specs: list[jdxi_editor.midi.io.controller_map.TransportSpec][source]
_learning_transport: jdxi_editor.midi.io.controller_map.TransportAction | None = None[source]
_status_timer: PySide6.QtCore.QTimer | None = None[source]
_timer_init()[source]
_create_tab_widget()[source]
build_tabs_dict() → dict[Callable[[...], Any], str][source]
_connection_tab() → PySide6.QtWidgets.QWidget[source]

The tab showing which ports are listened to.

Returns:

QWidget

_create_connection_tab_widgets() → tuple[PySide6.QtWidgets.QGroupBox, PySide6.QtWidgets.QGroupBox, PySide6.QtWidgets.QWidget][source]

_create_connection_tab_widgets

Returns:

tuple[QGroupBox, QWidget, QGroupBox]

create_port_combo()[source]
create_preset_combo()[source]
_preset_combo_current_index_changed_connect()[source]
_preset_combo_set_current_index()[source]
_preset_combo_populate()[source]
_create_action_item_buttons() → list[Any][source]

_create_action_item_buttons

create_action_button_specs() → list[picoui.specs.widgets.ButtonSpec][source]

create_action_button_specs

_create_midi_controller_form(actions: PySide6.QtWidgets.QHBoxLayout | PySide6.QtWidgets.QVBoxLayout, connection: PySide6.QtWidgets.QGroupBox)[source]
_monitor_tab() → PySide6.QtWidgets.QWidget[source]

The tab logging what the controller sends.

Returns:

QWidget

_mappings_tab() → PySide6.QtWidgets.QWidget[source]

The tab assigning a CC number to each filter control.

Returns:

QWidget

_build_mappings_table() → None[source]

Fill the mappings table from the current map.

Returns:

None

_transport_tab() → PySide6.QtWidgets.QWidget[source]

The tab assigning controller buttons to the MIDI File player’s transport.

Returns:

QWidget

_build_transport_table() → None[source]

One row per transport action, with its buttons, Learn and Clear.

Returns:

None

_transport_text(action: jdxi_editor.midi.io.controller_map.TransportAction) → str[source]

The buttons that trigger action, as shown in the table.

Parameters:

action – TransportAction

Returns:

str e.g. “Note 94, CC 52”, or “not set”

_refresh_transport_column() → None[source]

Redraw the Buttons column.

Returns:

None

_source_text(control: jdxi_editor.midi.io.controller_map.FilterControl) → str[source]

The hardware control that sends control by default, for the table.

Taken from the profile’s source entries in midi_controllers.json; blank where the physical control is not known (as for the VMX8, whose map is translated, not measured).

Parameters:

control – FilterControl

Returns:

str e.g. “Knob 1”, or “”

connected_profile() → jdxi_editor.midi.io.controller_map.ControllerProfile[source]

Profile of the controller plugged in, or the MiniLab 3 if none is.

Returns:

ControllerProfile

select_profile(profile_id: str | None) → None[source]

Show and edit the mappings of another controller.

Parameters:

profile_id – Optional[str] ControllerProfile id

Returns:

None

_is_live_profile() → bool[source]

Whether the profile being edited is the one the running remote uses.

Returns:

bool

_cc_text(control: jdxi_editor.midi.io.controller_map.FilterControl) → str[source]

The CC number assigned to control, as shown in the table.

Parameters:

control – FilterControl

Returns:

str

cc_for(control: jdxi_editor.midi.io.controller_map.FilterControl) → int | None[source]

The CC number mapped to control.

Parameters:

control – FilterControl

Returns:

Optional[int]

refresh_ports() → None[source]

Reload the list of MIDI input ports, keeping the current choice.

Returns:

None

connect_controller() → None[source]

Listen to the chosen port, or find the controller’s ports automatically.

Returns:

None

disconnect_controller() → None[source]

Stop listening to the controller.

Returns:

None

update_status() → None[source]

Show whether the controller is connected, and on which ports.

Returns:

None

information_text_update(available_ports: list[Any] | Any, ports: list[Any] | Any)[source]

information_text_update

Parameters:
  • available_ports

  • ports

Returns:

_on_message(port_name: str, message: object) → None[source]

Log a message from the controller, and use it if learning.

Parameters:
  • port_name – str the port it arrived on

  • message – mido.Message

Returns:

None

_append_monitor_line(line: str) → None[source]

Add a line to the monitor, dropping the oldest once it is full.

Parameters:

line – str

Returns:

None

start_learn(control: jdxi_editor.midi.io.controller_map.FilterControl) → None[source]

Take the next CC received as the mapping for control.

Parameters:

control – FilterControl

Returns:

None

cancel_learn() → None[source]

Stop waiting for a CC.

Returns:

None

assign_cc(control: jdxi_editor.midi.io.controller_map.FilterControl, cc: int) → None[source]

Map cc to control, replacing any other control using it.

A CC can only drive one thing, otherwise one knob would move two sliders at once.

Parameters:
  • control – FilterControl

  • cc – int CC number 0-127

Returns:

None

reset_mappings() → None[source]

Go back to the selected controller’s built-in map.

Returns:

None

apply_mappings() → None[source]

Save the map and, if it is the connected controller’s, hand it to the running filter remote.

Returns:

None

_refresh_cc_column() → None[source]

Redraw the CC numbers in the table.

Returns:

None

static _spec_from_press(action: jdxi_editor.midi.io.controller_map.TransportAction, message: object) → jdxi_editor.midi.io.controller_map.TransportSpec | None[source]

The transport button message presses, bound to action.

Parameters:
  • action – TransportAction

  • message – mido.Message

Returns:

Optional[TransportSpec] None if message is not a button press (a release, or neither a note-on nor a CC)

_show_transport_press(message: object) → None[source]

Name the transport action a button press triggers, if any.

Parameters:

message – mido.Message

Returns:

None

start_transport_learn(action: jdxi_editor.midi.io.controller_map.TransportAction) → None[source]

Add the next button pressed as a trigger for action.

Parameters:

action – TransportAction

Returns:

None

cancel_transport_learn() → None[source]

Stop waiting for a transport button.

Returns:

None

assign_transport(spec: jdxi_editor.midi.io.controller_map.TransportSpec) → None[source]

Add spec to its action’s buttons, taking it from any other action.

A button can only do one thing, so it is removed from the others.

Parameters:

spec – TransportSpec

Returns:

None

clear_transport_action(action: jdxi_editor.midi.io.controller_map.TransportAction) → None[source]

Remove every button bound to action.

Parameters:

action – TransportAction

Returns:

None

reset_transport() → None[source]

Go back to the selected controller’s built-in transport buttons.

Returns:

None

apply_transport() → None[source]

Save the transport buttons and tell the MIDI File player.

Returns:

None

closeEvent(event) → None[source]

Stop the status timer and any learn in progress.

Parameters:

event – QCloseEvent

Returns:

None