jdxi_editor.midi.io.controller_settings

The CC numbers a controller sends differ between devices, and between the programs of one device: the MiniLab 3 map in jdxi_editor.midi.io.controller_map is only a sensible default. What the user learns in the MIDI Controller dialog is kept here, in QSettings, so it survives a restart.

Each entry is stored as midi_controller/mapping/<control name> -> CC number, for example midi_controller/mapping/CUTOFF -> 74.

Learnt transport buttons are stored per controller as one JSON list under midi_controller/<id>/transport, in the form midi_controllers.json uses.

Attributes

MAPPING_GROUP

Functions

mapping_group([profile]) → str

QSettings group for profile's learnt mappings.

_settings() → PySide6.QtCore.QSettings

The application's settings store.

default_filter_map([profile]) → Dict[int, jdxi_editor.midi.io.controller_map.FilterControl]

The built-in map of profile.

load_filter_map([settings, profile]) → Dict[int, jdxi_editor.midi.io.controller_map.FilterControl]

The stored mapping, falling back to the built-in one per control.

save_filter_map(mapping[, settings, profile]) → None

Store mapping for profile, replacing whatever was there.

clear_filter_map([settings, profile]) → None

Forget profile's stored mapping, so its built-in one is used again.

_default_cc(control[, profile]) → Optional[int]

profile's built-in CC number for control.

_as_cc(value) → Optional[int]

Read a stored value as a CC number.

transport_key([profile]) → str

QSettings key holding profile's learnt transport buttons.

load_transport_specs([settings, profile]) → tuple[jdxi_editor.midi.io.controller_map.TransportSpec, ...]

profile's transport buttons: the learnt ones, or its built-in ones.

save_transport_specs(specs[, settings, profile]) → None

Store profile's transport buttons, replacing what was there.

clear_transport_specs([settings, profile]) → None

Forget profile's learnt transport buttons, so its built-in ones apply.

Module Contents

jdxi_editor.midi.io.controller_settings.MAPPING_GROUP = 'midi_controller/mapping'[source]
jdxi_editor.midi.io.controller_settings.mapping_group(profile: jdxi_editor.midi.io.controller_map.ControllerProfile = MINILAB3) → str[source]

QSettings group for profile’s learnt mappings.

The MiniLab 3 keeps the original group, so mappings learnt before other controllers were supported still load.

Parameters:

profile – ControllerProfile

Returns:

str settings group

jdxi_editor.midi.io.controller_settings._settings() → PySide6.QtCore.QSettings[source]

The application’s settings store.

Returns:

QSettings

jdxi_editor.midi.io.controller_settings.default_filter_map(profile: jdxi_editor.midi.io.controller_map.ControllerProfile = MINILAB3) → Dict[int, jdxi_editor.midi.io.controller_map.FilterControl][source]

The built-in map of profile.

Parameters:

profile – ControllerProfile defaults to the MiniLab 3

Returns:

dict CC number -> FilterControl

jdxi_editor.midi.io.controller_settings.load_filter_map(settings: PySide6.QtCore.QSettings | None = None, profile: jdxi_editor.midi.io.controller_map.ControllerProfile = MINILAB3) → Dict[int, jdxi_editor.midi.io.controller_map.FilterControl][source]

The stored mapping, falling back to the built-in one per control.

A control with nothing stored keeps its default CC, so a part-finished learn still leaves a usable map.

Parameters:
  • settings – Optional[QSettings] store to read; defaults to the application’s own

  • profile – ControllerProfile whose mappings and defaults to use

Returns:

dict CC number -> FilterControl

jdxi_editor.midi.io.controller_settings.save_filter_map(mapping: Dict[int, jdxi_editor.midi.io.controller_map.FilterControl], settings: PySide6.QtCore.QSettings | None = None, profile: jdxi_editor.midi.io.controller_map.ControllerProfile = MINILAB3) → None[source]

Store mapping for profile, replacing whatever was there.

Parameters:
  • mapping – dict CC number -> FilterControl

  • settings – Optional[QSettings] store to write; defaults to the application’s own

  • profile – ControllerProfile the mapping belongs to

Returns:

None

jdxi_editor.midi.io.controller_settings.clear_filter_map(settings: PySide6.QtCore.QSettings | None = None, profile: jdxi_editor.midi.io.controller_map.ControllerProfile = MINILAB3) → None[source]

Forget profile’s stored mapping, so its built-in one is used again.

Parameters:
  • settings – Optional[QSettings] store to clear; defaults to the application’s own

  • profile – ControllerProfile whose mapping to forget

Returns:

None

jdxi_editor.midi.io.controller_settings._default_cc(control: jdxi_editor.midi.io.controller_map.FilterControl, profile: jdxi_editor.midi.io.controller_map.ControllerProfile = MINILAB3) → int | None[source]

profile’s built-in CC number for control.

Parameters:
  • control – FilterControl

  • profile – ControllerProfile

Returns:

Optional[int]

jdxi_editor.midi.io.controller_settings._as_cc(value: object) → int | None[source]

Read a stored value as a CC number.

QSettings hands back strings on some platforms, and the file can be edited by hand, so anything unusable is discarded rather than trusted.

Parameters:

value – object stored value

Returns:

Optional[int] a CC number 0-127, or None

jdxi_editor.midi.io.controller_settings.transport_key(profile: jdxi_editor.midi.io.controller_map.ControllerProfile = MINILAB3) → str[source]

QSettings key holding profile’s learnt transport buttons.

Parameters:

profile – ControllerProfile

Returns:

str settings key

jdxi_editor.midi.io.controller_settings.load_transport_specs(settings: PySide6.QtCore.QSettings | None = None, profile: jdxi_editor.midi.io.controller_map.ControllerProfile = MINILAB3) → tuple[jdxi_editor.midi.io.controller_map.TransportSpec, ...][source]

profile’s transport buttons: the learnt ones, or its built-in ones.

Parameters:
  • settings – Optional[QSettings] store to read; defaults to the application’s own

  • profile – ControllerProfile

Returns:

tuple[TransportSpec, …]

jdxi_editor.midi.io.controller_settings.save_transport_specs(specs: Iterable[jdxi_editor.midi.io.controller_map.TransportSpec], settings: PySide6.QtCore.QSettings | None = None, profile: jdxi_editor.midi.io.controller_map.ControllerProfile = MINILAB3) → None[source]

Store profile’s transport buttons, replacing what was there.

Parameters:
  • specs – Iterable[TransportSpec]

  • settings – Optional[QSettings] store to write; defaults to the application’s own

  • profile – ControllerProfile

Returns:

None

jdxi_editor.midi.io.controller_settings.clear_transport_specs(settings: PySide6.QtCore.QSettings | None = None, profile: jdxi_editor.midi.io.controller_map.ControllerProfile = MINILAB3) → None[source]

Forget profile’s learnt transport buttons, so its built-in ones apply.

Parameters:
  • settings – Optional[QSettings] store to clear; defaults to the application’s own

  • profile – ControllerProfile

Returns:

None