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

Add ctrlmidich option for "own channel" regardless of number #3394

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

pljones
Copy link
Collaborator

@pljones pljones commented Oct 2, 2024

Short description of changes

From @AndersGoran.

This adds a ;z option to --ctrlmidich parsing that adds control of the client channel, regardless of its channel number. This applies to all the channel-specific controls used. It takes up one extra MIDI controller number for each.

CHANGELOG: Add ctrlmidich option for "own channel" regardless of number

Context: Fixes an issue?

Raised in https://github.com/orgs/jamulussoftware/discussions/2220#discussioncomment-10811813

Does this change need documentation? What needs to be documented and how?

Yes, but it needs reviewing to see if this is how we want to do it first.

Status of this Pull Request

Proof of concept.

What is missing until this pull request can be merged?

Needs reviewing and considering whether "own client id" concept should apply to all controls (e.g. use ;z as a switch to bump lock the first CC number for each control to "own client id").

Checklist

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

AUTOBUILD: Please build all targets

@pljones
Copy link
Collaborator Author

pljones commented Oct 2, 2024

There may currently be a problem with CSoundBase::ParseCommandLineArgument in that it doesn't necessarily set every element of aMidiCtls for each sMidiCtlChar but it doesn't check in CSoundBase::ParseMIDIMessage that the element exists.

So I'd like the ParseCommandLineArgument changed to ensure each possible option gets set to some "unset" default value and then overridden by the command line argument.

Separately, I'd like ;z<n> changed to just ;z and have that toggle "Use Own Channel Id In First CC For Control" mode -- so it's not just Fader that gets the benefit, it's Pan and Mute, too. Or have ;z<n> with <n> being the offset into the usual range of CC numbers for each control.

@pljones pljones self-assigned this Oct 2, 2024
@pljones pljones added feature request Feature request good first issue Things which should be doable without lots of context labels Oct 2, 2024
@pljones pljones added this to the Release 3.12.0 milestone Oct 2, 2024
@pljones pljones force-pushed the AndersGoran/ctrlmidich-for-own-channel branch from 2ade0ca to a8bb22e Compare October 2, 2024 18:13
src/sound/soundbase.h Outdated Show resolved Hide resolved
src/audiomixerboard.cpp Outdated Show resolved Hide resolved
@pljones pljones force-pushed the AndersGoran/ctrlmidich-for-own-channel branch 2 times, most recently from 18c8889 to c95a810 Compare October 4, 2024 19:26
@pljones
Copy link
Collaborator Author

pljones commented Oct 4, 2024

OK, so I decided to make the change I suggested.

Once the build is complete for Windows, I'll give it a try here.


The legacy definition has just one or two numbers that only provides a definition for the controller offset of the fader controllers (default 70 for the sake of Behringer X-Touch)

[MIDI channel];[offset for first fader]

The more verbose new form is a sequence of offsets and counts for various controllers:

[MIDI channel];[control letter][offset]*[count](;...)

Currently, the following control letters are defined:

Control control letter
Fader f
Pan p
Solo s
Mute m
  • offset is the base MIDI CC number for the control.
  • count is the number of CC values for the control (i.e. the number Jamulus channels that can be controlled).

Additionally, o has a single offset (i.e. count is ignored and taken as 1) and controls Mute Myself.

In addition, z reserves the first CC number for a control to mean "my Jamulus channel". For example

--ctrlmidich '1;f0*9;z'

would mean MIDI CC0 controlled my Jamulus channel fader, with CC1 to CC8 for Jamulus channels 1 to 8 (so if you were channel 6, you get two MIDI CC controls).

An example for a Korg nanoKONTROL2 with 8 fader controllers starting at offset 0 and 8 pan controllers starting at offset 16
would be

[MIDI channel];f0*8;p16*8

However, at the current point of time only 'f' and 'p' controllers are actually implemented. // may not be true...

@pljones pljones force-pushed the AndersGoran/ctrlmidich-for-own-channel branch 2 times, most recently from 76af113 to d790eb1 Compare October 4, 2024 19:37
src/sound/soundbase.h Outdated Show resolved Hide resolved
src/sound/soundbase.cpp Outdated Show resolved Hide resolved
@pljones pljones force-pushed the AndersGoran/ctrlmidich-for-own-channel branch from d790eb1 to 109d4eb Compare October 4, 2024 19:52
@pljones
Copy link
Collaborator Author

pljones commented Oct 5, 2024

Ugh, failure due to qt5 -> qt6. Investigating.


Fixed (more a compiler issue, I think).

@pljones pljones force-pushed the AndersGoran/ctrlmidich-for-own-channel branch 4 times, most recently from 42a80ac to 713cfbc Compare October 5, 2024 09:04
@pljones
Copy link
Collaborator Author

pljones commented Oct 5, 2024

OK, I can't get JACK to run without crashing on Windows any more for some reason. So I can't actually test this (as Jamulus ASIO doesn't support MIDI, as far as I know, and I've no MIDI - or audio - on my Linux box).

@pljones pljones added the needs documentation PRs requiring documentation changes or additions label Oct 5, 2024
@pljones pljones force-pushed the AndersGoran/ctrlmidich-for-own-channel branch from 713cfbc to 3f0983e Compare October 5, 2024 16:32
@pljones
Copy link
Collaborator Author

pljones commented Oct 5, 2024

@AndersGoran could you check whether the latest build is useable?

It should work like this:

--ctrlmidich 0;z;f0*9 gives you MIDI CC 0 controlling "my" fader, regardless of server-assigned Jamulus channel number, MIDI CC 1 controlling Jamulus channel 0 through to MIDI CC 8 controlling Jamulus channel 7.

It should work for all the Jamulus controls.

--ctrlmidich 0;z;f0;p1;s2;m3;o4 should give you control only over your own channel for fader, pan, mute (um, no, don't) and mute myself (better). --ctrlmidich 0;z;f0*9;p1*9;s2*9;m3*9;o4 gives you your own channel, plus additional controls for up to eight Jamulus channels, which could include your own channel. (If you were on Jamulus channel 3, you'd get MIDI CC 0 and MIDI CC 4 controlling your fader, for example; if you were on Jamulus channel 17, you'd still get control over your own channel and the first eight Jamulus channels.)

Note: remember, having control over your own channel only affects what you hear, not what others hear.

@AndersGoran
Copy link

I cloned https://github.com/pljones/jamulus.git, current HEAD is 3f0983e, compiles fine (I'm on macOS) but I'm afraid the "z" flag makes no difference. As before, my controller sends CC 100-103 from four separate pedals, so I use "0;z;f100*4" and the 100 pedal controls channel 0, 101 control 1, and so on. When I'm on e.g. 1, I have to use the pedal that sends 101 to move my fader.

Is there a pre-built executable somewhere that I should be using?

src/audiomixerboard.cpp Outdated Show resolved Hide resolved
@pljones pljones force-pushed the AndersGoran/ctrlmidich-for-own-channel branch from 3ba65c6 to 2e00f38 Compare October 8, 2024 20:07
src/audiomixerboard.cpp Outdated Show resolved Hide resolved
src/sound/soundbase.cpp Show resolved Hide resolved
@pljones pljones force-pushed the AndersGoran/ctrlmidich-for-own-channel branch 3 times, most recently from 47292d9 to 6091487 Compare October 12, 2024 11:36
@pljones
Copy link
Collaborator Author

pljones commented Oct 12, 2024

Coding Style Check / Verify Python coding style (pull_request)

Why did that fail?


#3408 raised.

@pljones pljones force-pushed the AndersGoran/ctrlmidich-for-own-channel branch 5 times, most recently from 738d470 to e142908 Compare October 12, 2024 16:00
src/audiomixerboard.h Outdated Show resolved Hide resolved
Copy link

@AndersGoran AndersGoran left a comment

Choose a reason for hiding this comment

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

I was requested to review, and while I'm not sure if you really want or need my approval regarding code details, I just tried the latest macOS build artifact jamulus_3.11.0dev-9cb1e39_mac.dmg and it still feels solid regarding the "z" flag.

src/sound/soundbase.cpp Show resolved Hide resolved
src/sound/soundbase.cpp Outdated Show resolved Hide resolved
@pljones pljones force-pushed the AndersGoran/ctrlmidich-for-own-channel branch from e142908 to 975e119 Compare October 14, 2024 17:11
@pljones pljones requested a review from ann0see October 14, 2024 17:12
@pljones pljones force-pushed the AndersGoran/ctrlmidich-for-own-channel branch from 975e119 to 3aa12d0 Compare October 14, 2024 17:51
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.

I have the feeling that documentation is lacking on explaining the code.
I feel unsure about the exact functionality - especially the cli parsing.

@pljones
Copy link
Collaborator Author

pljones commented Oct 15, 2024

I have the feeling that documentation is lacking on explaining the code. I feel unsure about the exact functionality - especially the cli parsing.

Which documentation?

What are you unsure about?

@ann0see
Copy link
Member

ann0see commented Oct 17, 2024

I think I need to go over the code in my editor. The diff on GitHub doesn't show me enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Feature request good first issue Things which should be doable without lots of context needs documentation PRs requiring documentation changes or additions
Projects
Status: Waiting externally
Development

Successfully merging this pull request may close these issues.

3 participants