jmamma / MCL

MCL firmware for the MegaCommand MIDI Controller.
BSD 2-Clause "Simplified" License
48 stars 9 forks source link

Midi machines, automation issues #189

Open ctag-fh-kiel opened 1 month ago

ctag-fh-kiel commented 1 month ago

I have a question with regard to the following scenario:

  1. MD Midi Machine assigned to a track
  2. Punched in a couple of trigs in enhanced mode
  3. Automatized some Midi Machine parameters per trig in grid mode within enhanced mode
  4. Set up MCL internally routing Midi 1 IN to Midi Out 2 (pg. 24f of MCL 4.5.1 documentation)
  5. Midi Out 2 data only reflects note on/offs of Midi Machine but none of the recorded automations

It would be great if the automations are sent as well, making this useful for sequencing external gear with a MD Midi Machine and MCL in enhanced mode.

Is this currently the desired behaviour or am I missing something?

jmamma commented 1 month ago

MD MIDI machines are currently not supported with MCL. The PianoRoll can be used to transmit MIDI notes on port 2.

ctag-fh-kiel commented 1 month ago

Thanks, good to know! Is it possible to record CC automation data in the PianoRoll?

Which are the points in the source code to possibly implement MD Midi machine support, I could have a look at? Maybe I can figure something out. Or is it more a technical limitation as for each step on the grid Midi is sent from MCL to MD and would then be re-sent from MD to MCL and forwarded to port 2 (which does sound to be timing wise a challenge)?

Cheers :)

On Sun, Jul 14, 2024 at 2:49 AM jmamma @.***> wrote:

MD MIDI machines are currently not supported with MCL. The PianoRoll can be used to transmit MIDI notes on port 2.

— Reply to this email directly, view it on GitHub https://github.com/jmamma/MCL/issues/189#issuecomment-2227152912, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZMGRVY6HIQDNEJ2YZMM7LZMHDIPAVCNFSM6AAAAABK2L43CKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRXGE2TEOJRGI . You are receiving this because you authored the thread.Message ID: @.***>

jmamma commented 1 month ago

Is it possible to record CC automation data in the PianoRoll?

Yes, see the PianoRoll section of the manual. Each track can automate up to 8 CCs.

Or is it more a technical limitation

You can find the main sequencer code MCLSeq::seq() in MCL/MCLSeq.cpp, We also have the MDSeqTrack::seq() and ExtSeqTrack::seq() classes for the MD and PianoRoll sequencers.

The idea would be to emulate the MD's MIDI sequencing via the MCL sequencer, and transmit directly from the MegaCommand's port 2.

There's at least three main issues. The first being, we would need to implement a distinct type of sequencer routine for the MIDI tracks. The MDSeqTrack::seq() routine, only needs to trigger a track once for each step trig. With the MIDI machines you need to send MIDI_NOTE_ON and then wait some duration before sending the MIDI_NOTE _OFF.

The second issue is the GUI aspect. Currently the MIDI tracks on the MD transmit on their specific channel. I.e MID-05 transmits all control changes on channel 5. In normal circumstances (all other machines excluding CTR-*), the MD transmits within the range of (globalBaseChannel, globalBaseChannel + 4). MCL monitors parameter changes via MIDI CC. So any parameter value changes on the MD-MIDI tracks need to be intercepted.

The GUI implementation on the MD is accessible to me, so I would likely be able to change the GUI MIDI channel behavior for Enhanced Mode.

The third issue would be related to the number of parameters with locks. The MDSeqTrack::seq() routines were designed for 8 parameters, due to memory and cpu constraints. The MIDI machines really lend themselves towards 8+ parameters with locks.

--

sent from MCL to MD and would then be re-sent from MD to MCL and forwarded to port 2 (which does sound to be timing wise a challenge)?

And can't really do it this way because MCL transmit quite a bit of sysex data back and forth with the MD. Large sysex transfers result in latency issues for MIDI note data.

ctag-fh-kiel commented 1 month ago

Thx for the detailed reply.

Now I am wondering if in the automation editor track menu one could learn the Midi CC also from Midi in 1, coming from the MD. If one has set up a midi machine on the MD, one could use that to send Midi CC to MCL via moving the MD pots. This could be recorded in piano roll.

Somehow CC can only be learned from Midi in 2.

Could this be technically feasible?

jmamma commented 1 month ago

From memory it's mostly coded to use port2, See the SeqPtcMidiEvents::onControlChangeCallback functions in SeqPtcPage.cpp.

--

On a side note I fixed the MD GUI issues for the MIDI tracks when in enhanced mode.

Just coding up first pass of the MIDI Machine sequencer code.

ctag-fh-kiel commented 1 month ago

Very cool, thx. I will have a look at it. My use case is to connect a Midi version of CTAG TBD. TBD is a flexible audio processing module, currently available as Eurorack. The Midi version (in the works) can be a great extension to Elektron boxes by using their sequencer or the MCL. Let me know if you are interested, I could spare a prototype of the Midi TBD.

jmamma commented 1 month ago

@ctag-fh-kiel jump on our discord when you have a chance and I can share the updated MD firmware.

https://discord.gg/reFptpH6gp

jmamma commented 1 month ago

https://github.com/jmamma/MCL/pull/191 <--- untested.