Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support more than one MIDI In/Out #297

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from

Conversation

s0600204
Copy link
Contributor

This PR adds the ability to connect to more than one MIDI input and output at a time, allowing for listening to messages coming from more than one Interface or Port, and different MIDI cues sending messages to different locations.

Currently, there is a limit of 16 inputs and 16 outputs, but this could be raised or removed (although there's probably a maximum number that ALSA or Jack can handle).

The interface to define MIDI inputs and outputs now looks like:
settings

With it now possible to select which of the predefined outputs is to be used for a MIDI cue:
midi_cue

And which of the predefined inputs should be listened to for Cue and Layout Controls:
layout_controls

(The Preferences dialog could probably do with being a little wider, but that's out of scope for this PR.)

Background only: the UI hasn't been altered yet
To permit eventual retention of patching within cues (instead of using {n}th device, which may change between file loads)
Whilst it gets populated, and the UI reacts to user input, changes made are not saved.
Which emits whenever any input patch receives a new message. This allows
listeners to receive from all patched inputs easily, rather than having to
connect to them all individually. (And have to track when new patches are
added and handle when patches they're listening are removed.)
Sven if it doesn't match an available device
This is a bit of an odd solution, as whilst LiSP's configuration code detects
whether a config (sub)key has been added or had its associated value changed,
it doesn't pick up on key deletions.

Thus, we null the stored device name, and just treat any device patches with a
null'd name as if it doesn't exist.

Another odd quirk with LiSP's Signal class in that it doesn't like to be
connected to a slot belonging to a Qt5 widget, due to not being able to see
the slot's method signature. Hopefully the use of PyQt5's pyqtSignal class
instead doesn't cause any problems.
In the case that no patches are defined in `inputDevices` and `inputDevice`
doesn't exist in the config, don't create a default input patch.

Ditto for outputs.
1) So we don't throw an error about connecting to a non-existent port

whilst,

2) If it becomes available later, it should connect automagically (assuming rtmidi and ALSA backends)
Really need a wider Preferences UI!
@FrancescoCeruti FrancescoCeruti self-assigned this Nov 26, 2023
@FrancescoCeruti FrancescoCeruti added this to the v0.7 milestone Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants