Add MIDI GUI tab and learn function#3502
Add MIDI GUI tab and learn function#3502ignotus666 wants to merge 1 commit intojamulussoftware:mainfrom
Conversation
|
Thanks for this contribution. It looks like a useful feature. I will be happy to test it in due course, on Linux, Windows and Mac, but at the moment most of my kit is packed away for a pending house move. |
|
@softins thanks - no worries, I guess there will be plenty of time for testing before this ever makes it in (if it does). Hope the house move goes smoothly. |
|
Nice! I'd like to open a discussion:
|
In any event, this is still under development as I'm finding that some of my implementations are far from perfect. E.g. the way the MIDI in port is currently kept open I think has been done wrong, so I'm working on that. I'm testing a version where the MIDI port can be enabled/disabled at runtime, as among other things it affects whether numbers are prepended to user names in the mixer board - if you're not using MIDI you won't want that. The main purpose for opening this PR was to generate builds for other platforms for testing, but for now it's just a PoC that's far from finished, so any suggestions are welcome. |
|
Tested on Linux, Windows (no JACK) and macOS (legacy and non-legacy), and it seems to be working on these three platforms at least. |
|
OK just stumbled onto this. As this is a new feature, the following need to be adhered to:
(The "learn" feature for JSONRPC would just be the eventual "set X to Y" update, the visual behaviour would be for the JSONRPC user to supply - it just needs to be able to send the same update to the core code as the Client UI.) |
pljones
left a comment
There was a problem hiding this comment.
Get rid of all the unnecessary changes in spacing and resubmit the PR. As it stands, I can't review it.
Done. Those keep getting added in by clang.
It's been almost a year since I did this, but as far as I recall it updates the main application state via pSettings and pClient. |
|
I believe this should be rebased and squashed into one commit. |
It looks pretty good -- as @ann0see says, please rebase and squash. Then check the resultant diff for anything obvious 😄 - it looks mostly okay to me but there's a few places I'm not sure what was being intended, so I might have some more questions. One thing I might ask is for the command line parsing code to be moved into |
fe82247 to
7097b29
Compare
Done.
Done. I don't know what clang is whining about - I can't use it because it reformats a ton of stuff that shouldn't be. |
Known issue. We should really bump the clang format version. Otherwise be sure to use the same clang format version as used in the CI |
I've been working on this - should the UI immediately reflect changes from JSONRPC commands sent? It doesn't seem to do this for the existing commands but just to confirm. |
The problem is that in the TODO blocks, the TODO lines don't have a space after |
26f4096 to
1f2f394
Compare
I just went with the old behaviour - aside from the default 70 value for faders, the rest were 0. I see what you mean though, so maybe we can make the default "disabled" (represented by "--" or something similar to fit)? |
I've been holding back on adding the latest MIDI device selection code to this PR pending a go-ahead by you guys. If it's ok by you I'll add it and I'm fairly confident the iOS build won't fail. |
|
I think the default "count" was also zero, though? Anyway, please push what's here to the PR (do rebase and squash if needed). I don't think you can put "--" into the spinner (it would look odd) but on the heading line you could add a checkbox (it doesn't need a visible label) and have that enable the settings for that control? (Breaks your panel-based approach, though.) EDIT: Mmm, bold labelled checkbox with "Fader", or whatever as the label, rather than the panel border title? If you can get a checkbox in as the title, even better! If you do change the layout, you could change "MIDI-in" to "MIDI Control" and move the device selector next to it, labelled "Device", perhaps, to save a bit of space. (Or are MIDI device names long sometimes?) |
|
I'm pretty certain "count" was 1 as default, but what about this: Make the default count zero, which means that the affected item is disabled in practice ("zero controls in this category will react to a MIDI message"). This saves us cluttering up the UI with more items. It could be explained in the tooltip and manual - "Setting 'count' to zero will disable that control". |
|
Mute Myself doesn't have a count though. Somehow it's not active with the (And it's bad UX to conflate concepts like "count" and "active".) ... even if it's stored in the settings as a count of zero (and we store a dummy count for Mute Myself), it should display separately. |
My reasoning is that a "count" of zero is simply that - zero controls will react to it. I don't think it undermines the logic attached to the "count" concept and provides a way to "disable" controls (set to whatever note) that is far easier to implement than having a bool flag and checkbox for every control... As for Mute Myself: make the default CC -1. That way it doesn't get mapped and won't react to anything. |
|
I know it makes the work easier. @gilgongo, as our resident UI/UX arbitrator, what do you reckon? Is it okay to go with this? |
03adfbc to
0bd87d6
Compare
|
Here's what Gemini made of it: Full text of prompt:
It sounds like Gemini thinks there's a "Checkable Groupbox" -- but AI can make mistakes (and I wouldn't trust Gemini with coding, to be honest). The winning point for me is one I didn't think of, though -- if I disable a control temporarily, I don't want to have to go through the process of setting the value again to get it working. Surprisingly fast response by one of my local LLMs under Ollama: |
|
Fair enough, it makes good points. Will get to work on it, and yes, checkable groupboxes are a thing. I'll make one for Mute Myself too to make it consistent. iOS build succeeded BTW. |
Yes, if you update to latest on main from upstream and then rebase, that might fix your iOS build. Mostly because of I'd imagine. |
0bd87d6 to
688e11c
Compare
|
If the command line is specified at all, then nothing should be written back to settings, IIRC? Not that there's any examples for the client but I think the server works like that (if you run the GUI and specify a Directory to register with, then change it in the UI, I don't think it gets updated in settings). As I've mentioned, there's a lot of discussion about how that should work... To me, if I've set everything in the UI and then as a one off run with And I probably want the saved settings for any |
|
(Approximation again in markdown...)
and make sure the width on the spinner and its container can expand as needed. |
That should fix your branch iOS build. You should keep |
688e11c to
c8e251d
Compare
c8e251d to
355183e
Compare
I agree. But after having a look, the server settings actually behave more or less the way the MIDI settings do now: they skip reading the ini file if the command line option is present and later write any command line-specified values to the ini file later. What to do with non-specified controls in MIDI commands is a different matter though because AFAICT it's the only command line option that has a number of optional parameters within it, so there's not really a precedent for that scenario. I agree that they should be left alone and at most just disabled, not overwritten with defaults. Though this requires changing the current approach where the command line is checked first, to reading the xml and then checking the command line. The latest version does this:
I also fixed a bug where the "Learn" buttons for disabled controls would become active after using Learn for an active control.
It's those stupid up/down arrows that take up so much space. Please check the latest version to see if it's fixed. Oh, and another thing - please test launching a server. After years of being able to launch and connect my own, my bl**dy ISP has changed its policy and now I'm behind CGNAT and no IPv6 available, so I can't test that. It should be fine, but just in case. |
I've no IPv6, either. IPv4 registered okay with Any Genre 1 and one of my local Directories. Local connection worked fine. I'm seeing from the client (Audio, UI and Client threads, I think) and from the server (UI and Server threads) when the UI shuts down normally. @softins any idea what this is about? ... I'm vaguely remembering it was mentioned somewhere before... |
I've seen it too. I think it's been around for a while, but as it only happens when exiting, it doesn't seem to be a problem. I have never investigated the cause. |
Urgh. But you might be able to use Hurricane Electric tunnels to enable IPv6. I'd open a support ticket with the ISP saying something like your "connectivity is broken for IPv6 and you need it". |





Adds a MIDI tab to the Settings menu and exposes the MIDI parameters so they can be changed via the GUI. MIDI CC numbers can be automatically set using "learn" buttons that when pressed, listen for an incoming MIDI message and store it. Starting Jamulus with
--ctrlmidichcommand line arguments overrides and replaces those set via the GUI.The MIDI-in port can be enabled/disabled at runtime instead of it being determined at launch by the
--ctrlmidichparameter or by making it permanently open. This means that user names are prepended by a number depending on whether the MIDI in port has been enabled or not (as is the case now).I've also ditched the "Offset" term, at least for the GUI. It's a hangover from the days when that's what it was, a value hard-coded for a specific Behringer device, but in the current context it no longer makes sense.
EDIT: Added JSONRPC support.
CHANGELOG: Client: Added MIDI tab to Settings GUI exposing MIDI parameters. MIDI Learn feature also added.
Context: Fixes an issue?
Does this change need documentation? What needs to be documented and how?
Needs to be documented.
Status of this Pull Request
Working on Linux, Windows and macOS but should be tested more thoroughly.
What is missing until this pull request can be merged?
Further testing and code review.
Checklist