Skip to content

Comments

Feature midi pan issue 95#945

Merged
ann0see merged 5 commits intojamulussoftware:masterfrom
dakhubgit:feature_midi_pan_issue_95
Feb 14, 2021
Merged

Feature midi pan issue 95#945
ann0see merged 5 commits intojamulussoftware:masterfrom
dakhubgit:feature_midi_pan_issue_95

Conversation

@dakhubgit
Copy link
Contributor

This implements the command line parsing for my last proposal on issue #95 . It provides for specifying controllers for fader, pan, solo and mute buttons, but the implementation only retains the functionality for faders (though using a different framework) and in a final commit adds support for panning via MIDI.

I don't have an actual clue what I am doing, so the implementation may well be mistaken. Also the code style seems designed to thwart all conventions and it not supported by any editor or project I know, so I had to constantly fight my editor and may have gotten parts wrong.

@dakhubgit dakhubgit force-pushed the feature_midi_pan_issue_95 branch from 78abed8 to 0e26069 Compare February 2, 2021 22:22
@dakhubgit
Copy link
Contributor Author

dakhubgit commented Feb 7, 2021

Here is to the followup work: it's actually a bit more tricky. Mute and Solo keys may be on toggle-type or push-button controllers. One could just indicate those with different letters ('M' for toggle, 'm' for push-button). They have lights inside. Obviously the cleanest way is to have them as push buttons (which is the default I think) and let the program decide whether to light them (since only that way the light can react to the user changing the state in the GUI). However, that requires an actual Midi-out channel. It also requires keeping track of Mute/Solo in the program, and as far as I understand the code, the program does not keep track itself but only lets the toggle buttons in the GUI (which are absent in HEADLESS compilation) do that.

Obviously one purpose of using a Midi controller is to support headless operation, like with a Raspberry Pi. So I am not overly clear with the sensible default strategy.

The only thing that works reasonably without bidirectional Midi is "toggle button, decides on its own lighting". For the Korg nanoKONTROL2, you can use the delivered app to put it in this mode, and if you use the GUI for changing the buttons, they may go out of sync with the button lights and state on the controller and may require two presses there to resynchronise (like with the non-motorised faders).

So I'll likely follow up with options for that behavior: that allows one to configure and use the nanoKONTROL2 sensibly in this regard, even if it's not the nicest config imaginable.

@dakhubgit
Copy link
Contributor Author

Is this typical for Jamulus development? This merge request was made a week ago. There was no substantial comment, only after 3 days a request to change the formatting to the "standard". This being done, there continues to be no substantial comment, no review. Without 2 approving reviews, the patch is dead.

This is not exactly encouraging to contributors. Why invest effort in a project that chooses to play dead to would-be contributors and has set its rules such that they have no chance to actual get anywhere?

@pljones
Copy link
Collaborator

pljones commented Feb 10, 2021

Ah, I wasn't clear on

So I'll likely follow up with options for that behavior: that allows one to configure and use the nanoKONTROL2 sensibly in this regard, even if it's not the nicest config imaginable.

I thought you meant as part of this PR. Do you consider this now complete?

@dakhubgit
Copy link
Contributor Author

dakhubgit commented Feb 10, 2021

Ah, I wasn't clear on

So I'll likely follow up with options for that behavior: that allows one to configure and use the nanoKONTROL2 sensibly in this regard, even if it's not the nicest config imaginable.

I thought you meant as part of this PR. Do you consider this now complete?

The work on the buttons is more complicated because the relation between headless and headed does not work in the same way, with no explicit scorekeeping at least of the solo buttons but rather stuff getting collected via the GUI. So that followup work is a lot fuzzier, needs a separate discussion. Particularly so as there are different semantics for toggle controllers and push controllers to be implemented (there may be some point in using s and S letters to differentiate between the two, with the latter needing to maintain state somewhere out of the GUI). As I said, I don't know my way around the code, and the pan code is strictly analogous to what the fader code does. The process for getting the buttons done and accepted is predicated on more feedback from other people, and the way it looks I am getting absolutely zero feedback for now.

This PR is not marked as "draft" and I have addressed the only feedback I got, namely that it needed to be formatted differently. I'll probably do some followup work that works with my particular controller, but given the complete lack of interest or feedback it is not clear that there is a point in submitting something that will likely benefit few people other than myself.

@dakhubgit dakhubgit force-pushed the feature_midi_pan_issue_95 branch 2 times, most recently from ce03446 to 6e69590 Compare February 10, 2021 23:40
@pljones
Copy link
Collaborator

pljones commented Feb 11, 2021

@ann0see @softins Can you check this over for anything I might have missed, please?

@ann0see
Copy link
Member

ann0see commented Feb 11, 2021

Unfortunately I can't comment much on this (I don't own a midi controller and don't necessarily the C++ code since I'm not a C++ dev). The only thing I can say is that it seems to compile... I can have a look at the code and try to understand it of course.

I do support this PR: controlling Jamulus especially on a headless Raspberry Pi is a feature I strongly support (I think I even commented something like this in #472 (comment), not sure though Yes. It's there.)

Is this typical for Jamulus development? This merge request was made a week ago. There was no substantial comment, only after 3 days a request to change the formatting to the "standard". This being done, there continues to be no substantial comment, no review. Without 2 approving reviews, the patch is dead.

Is probably a bit more complicated. I really appreciate every contribution and this keeps the community alive. A lot was going on since corrados left and I think we must sort some things out...

Copy link
Member

@ann0see ann0see left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, I can't comment much here. But I assume it's ok.

@dakhubgit dakhubgit force-pushed the feature_midi_pan_issue_95 branch from 6e69590 to c084cbc Compare February 11, 2021 14:06
@softins
Copy link
Member

softins commented Feb 11, 2021

@ann0see @softins Can you check this over for anything I might have missed, please?

Yes, sure, but I won't have much time until Friday.

Copy link
Member

@softins softins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I've read the changes and the comments already made, and am happy to approve the PR.

On a general note, the syntax for the argument to --ctrlmidich is quite arcane, and we need some additions to the documentation to:

  • describe the syntax, and
  • give some example recipes for devices

@dakhubgit
Copy link
Contributor Author

dakhubgit commented Feb 12, 2021 via email

@softins
Copy link
Member

softins commented Feb 12, 2021

On a general note, the syntax for the argument to --ctrlmidich is quite arcane, and we need some additions to the documentation to: * describe the syntax, and * give some example recipes for devices

Sure. It's just that previous to my patch there was no documentation of the current behavior to be found anywhere except in some Wiki pages, so it was not clear where and how the new behavior should be documented. So it's not really a degression but an ongoing disgrace.

Indeed, it wasn't intended as a criticism of the PR, but just highlighting the need for more info to be put somewhere. The only info I've found so far is at https://jamulus.io/wiki/Tips-Tricks-More#Using-ctrlmidich-for-MIDI-controllers

@ann0see
Copy link
Member

ann0see commented Feb 12, 2021

Probably we need to add something in the documentation, but I'm quite sure @ignotus666 already added them. It'll be part of the new documentation release ;-). @dakhubgit since It's your first PR, could you please add yourself to the contributor list and document this change in the Changelog?

@ignotus666
Copy link
Member

I haven't documented this latest change yet because I'm not really sure what the commands should actually look like. To document the previous change (CC offset) and provide the right syntax I had to trawl through PRs and do repeated tests to check what worked and what didn't... If you could just give me a brief summary of what has changed and what the real-life commands should look like I'll be happy to add it to the documentation.

@ignotus666
Copy link
Member

BTW @dakhubgit your work on MIDI is much appreciated - I'm one of the (apparently few) people who find it really useful.

@pljones
Copy link
Collaborator

pljones commented Feb 12, 2021

Given the syntax is backwards-compatible, we could go ahead and merge this separately from the docs change. We don't lose anything.

@dakhubgit dakhubgit force-pushed the feature_midi_pan_issue_95 branch from c084cbc to db88019 Compare February 12, 2021 23:58
@dakhubgit
Copy link
Contributor Author

dakhubgit commented Feb 13, 2021

Probably we need to add something in the documentation, but I'm quite sure @ignotus666 already added them. It'll be part of the new documentation release ;-). @dakhubgit since It's your first PR, could you please add yourself to the contributor list and document this change in the Changelog?

I put something into the ChangeLog, and since is seems weird to put some half-feature in, I did add an implementation for mute/solo that is enough to use with a Korg nanoKONTROL2 after configuring all the respective buttons as toggles with Korg's utility (it even works under Wine once you set the device properly: actually configuring the device and having it autodetected are mutually exclusive, so you need to ignore and override the initial autodetection "success"), and preferably turn controller LED access to 'internal' so that the controller itself lights and unlights the buttons according to the state they are in.

In that case, --ctrlmidich '1;f0*8;p16*8;s32*8;m48*8' will work for having everything work, of course with the caveat that changes in the GUI will not get reflected at the controller but only the other way round. I am not up to coding the necessary stuff for a bidirectional MIDI connection.

This will not work (pretty sure) for headless regarding the solo/mute buttons. Also I can find no "contributors' list" that would be manually maintained: it would appear that just an automatically generated list is referenced in the README file.

@ann0see
Copy link
Member

ann0see commented Feb 13, 2021

Sorry. I forgot to link the file/commit.

See this commit on how to add yourself: 8fa8581

This will not work (pretty sure) for headless regarding the solo/mute buttons.

Can you test if it works on the headless build? It would be great if you were wrong/could find a workaround.

All in all this sounds like a great feature!

@ann0see ann0see requested review from pljones and softins February 13, 2021 06:23
@dakhubgit dakhubgit force-pushed the feature_midi_pan_issue_95 branch from db88019 to 3b758ed Compare February 13, 2021 12:20
@dakhubgit
Copy link
Contributor Author

Sorry. I forgot to link the file/commit.

See this commit on how to add yourself: 8fa8581

I've added myself there, but since I don't want to see my name associated with bad HTML (or at least invalid XHTML) code, I am inconsistent with the other contributors in that I actually quote the href link references. If they were intentionally unquoted, I find it offensive to the reader to pretend otherwise by inserting "" (which is ignored in C++ strings) gratuitously.

So I have no idea whether this is allowed to stand.

@ann0see
Copy link
Member

ann0see commented Feb 13, 2021

@dakhubgit Thanks for spotting and bringing up this mistake. @softins is already working on fixing it for all contributors: #945 (comment)
So your suggestion is the only right thing here, I suppose.

Copy link
Member

@softins softins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is mainly fine, except for the typo and needing to add the headless support for Solo and Mute.

@dakhubgit dakhubgit force-pushed the feature_midi_pan_issue_95 branch 2 times, most recently from aff3176 to a3628f8 Compare February 13, 2021 13:21
@softins
Copy link
Member

softins commented Feb 13, 2021

I've added myself there, but since I don't want to see my name associated with bad HTML (or at least invalid XHTML) code, I am inconsistent with the other contributors in that I actually quote the href link references. If they were intentionally unquoted, I find it offensive to the reader to pretend otherwise by inserting "" (which is ignored in C++ strings) gratuitously.

So I have no idea whether this is allowed to stand.

@dakhubgit I think it was a genuine mistake from long ago, thinking that a quote could be embedded in a string by doubling it, which works in some languages, but not C++, although it is not a syntax error, just adjacent string concatenation.

#989 fixes it in all places in the code where it occurs. This was not the only occurrence.

@dakhubgit dakhubgit requested a review from softins February 13, 2021 21:42
Copy link
Member

@softins softins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'm happy to approve this. Headless clients can be addressed in the future.

This is preparation for continuing work on issue jamulussoftware#95.  While it does
not yet introduce functional differences, MIDI controller information
is organised in a manner where reacting to more than just fader
control messages becomes easy.

The preparation right now is for controllers of type fader, pan, solo,
mute but can be easily extended for other messages arriving on a
single channel.
As part of issue jamulussoftware#95, this implements a new way of specifying various
controllers.  The previous possibilities are retained.  This leaves

--ctrlmidich <n> receives on channel n (if 0, on all channels), offset
   to first fader is 70 (Behringer X-Touch)

--ctrlmidich <n>;<off> for specifying a different offset

--ctrlmidich <n>;f<off>*<channels>;p<off>*<channels> specified offsets
for fader controllers and pan controllers, respectively.

There are also s<off> and m<off> specs for Solo and Mute buttons,
respectively.

This only concerns the command line parsing: the actual implementation
is only there for the volume faders.
This actually implements the --ctrlmidich options for panning with a
MIDI controller for issue jamulussoftware#95.  For example, in native mode a KORG
nanoKONTROL2 can be used with

Jamulus --ctrlmidich '0;f0*8;p16*8'

since its colume faders start at controller 0 and its pan pots start
at controller 16.
This implements the --ctrlmidich controller specifications 's' and
'm'.  Since the MIDI connection is onedirectional and it is not clear
how controller state may be maintained for headless operation, this
currently relies on the controller maintaining and displaying
state (and accepting that changing the state via the GUI will let the
states of controller and GUI diverge).

It's not clear to me what this implies for headless operation and what
kind of code might need to get added to make that work.
Also add David Kastrup to contributor list.
@dakhubgit dakhubgit force-pushed the feature_midi_pan_issue_95 branch from a3628f8 to 1131be7 Compare February 14, 2021 19:10
@ann0see
Copy link
Member

ann0see commented Feb 14, 2021

Didn't follow the last steps, but is this now ready to be merged and part of the next release?

@dakhubgit
Copy link
Contributor Author

Didn't follow the last steps, but is this now ready to be merged and part of the next release?

Well, it's backwards compatible and as good as I manage to get it without considerably more involvement for the headless case. If someone wants to do headless, that would apparently involve some refactoring of what gets done where that is not really a reasonable match to the acquaintance with the code I have. It may or may not involve further changes on panners/faders in order to make for a coherent whole.

So from my point of view, that's where I can get it. Let's see if it inspires further feature/extension requests or not once it is part of the code base.

@ann0see ann0see merged commit 856fa96 into jamulussoftware:master Feb 14, 2021
@ann0see
Copy link
Member

ann0see commented Feb 14, 2021

Ok. So I've merged this now.

@dakhubgit dakhubgit deleted the feature_midi_pan_issue_95 branch February 14, 2021 20:57
@ignotus666
Copy link
Member

Sorry if I'm asking the obvious, but I want to document this change and would like to better understand what's going on.

In, e.g.: --ctrlmidich <n>;f<off>*<channels>;p<off>*<channels>

  • What does <channels> refer to? Is that the MIDI channel (1-16)? Is it 0 for all channels too?
  • Does the offset default to 70 (like for the fader) if none is specified for p, s and m?

Cheers.

@dakhubgit
Copy link
Contributor Author

dakhubgit commented Feb 15, 2021 via email

@ignotus666
Copy link
Member

Ok, thanks. Again, sorry, but my experience with MIDI controllers is limited - so would f30*8 mean "CC numbers for faders start at 30 and end at 37"?

@dakhubgit
Copy link
Contributor Author

dakhubgit commented Feb 15, 2021 via email

@pljones pljones added this to the Release 3.7.0 milestone Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

5 participants