Dear M4L community, first time poster, absolute beginner with M4L.
I'm trying to write a MIDI parser in M4L for a module (hardware) I've built.
It's a simple monophonic MIDI 2 CV converter, it receives MIDI messages of the following type:
1. pitch + pitchbend
2. note (on/off)
using the MIDI standards, it then converts those to CV using a quad 16bit DAC, each DAC is dedicated to those parameters, that's what the hardware looks like (attached photo):
The hardware extracts all the incoming MIDI values (3.5mm stereo to MIDI adapter cable) and converts them in the following manner:
1. MIDI pitch + pitchbend is parsed to -3V to 5V range.
2. MIDI modulation is parsed to 0V-5V, effectively 39mV per 1 MIDI value change.
3. MIDI velocity is parsed to 0V-5V, effectively 39mV per 1 MIDI value change.
4. Note ON = high = 5V, else = low = 0V.
The MCU does not require any other arguments, and receives on CH1 by default, there is a DIP Switch on the PCB to set a different channel if needed.
Now, what I'm trying to do, is build a Plug-In in M4L that does the following:
Incoming DAW MIDI (to plug-in) is being fragmented into:
1. Pitch + Pitchbend then THRUed
2. Note ON/OFF simply THRUed (but without any additional arguments!)
3. Velocity is simply bypassed/ignored altogether, completely!
4. Modulation is redirected to f.e. a live.dial but NOT THRUed to MIDI out.
The Plug-In UI would consist of 3 live.dials.
1. ModWheel dial = accepts Modulation, it does not do anything by itself, nor forwards that info (can be mapped further if needed, but basically just hangs in the "air").
2. Mappable "vel out" dial -> whatever is mapped here, is being forwarded to MIDI velocity out (0-127 value range).
3. Mappable "mod out" dial -> whatever is mapped here, is being forwarded to MIDI CC1 (0-127 value range).
Attached a diagram as PNG (open in new TAB for enlarged version) and PDF
Can someone help me wrap my head around isolating the velocity?
I've figured out how to map anything to output on CC1 = modulation.
But I need to understand is, how:
1. Velocity can be decoupled from flow.
2. Can be replaced by a dynamic dial that does not simply bang out a value once on Note = on, but continuously runs its course.
The built-in envelope that ships with Ableton can be mapped to a dial, here's the course:
1. Note = ON message triggers said envelope, the attack rise begins
2. I can write a patch that bangs/triggers/makenote with the Note pitch value while the Envelope modulates the dial, that I figured out.
What I cannot influence, is that in my MIDI log I see the following example values:
Left = incoming MIDI, Envelope is triggered -> modulates the dial -> MIDI output rises to envelope peak, but with every value change it constantly also jumps back to "0" inbetween, which causes artifacts in CV jumps, think metalic FM. It looks like Ableton considers every "released" note to have to go back to velocity value 0 before it can be played again. Is there any way to bypass velocity going back to zero? I just want the envelope to run its course and bang out the note + value til it reaches a natural zero.