Use M4L to create MIDI clip, populate with cc values
Hi, I'm looking for a way to do the following from a Max4Live device:
1. Create a MIDI clip of a given length in bars in my arrangement timeline.
2. Give the clip a specific RGB color.
3. Set a number of MIDI cc values at the beginning and at the end of said clip.
So far, I've managed to create a clip with a desired number of bars in session view. I think I should be able to use "call duplicate_clip_to_arrangement" to get it into my timeline once I figure out the correct way.
Clip color is something I'll look into later, but right now I'm completely stuck on the last one: writing cc's to a MIDI clip.
Is this even possible? I know I could record the output from my device into another track, but that introduces timing imprecisions, and what I'm looking for is really a quick way to create individual clips with specific cc's.
____________
Some background: I'm programming MIDI to control my band's stagelights. Each light responds to three specific cc's for red, green and blue. We don't use a laptop live so I can't control them directly from a Max4Live device, I need actual MIDI I can export and play on a Cymatic LP16 (a dedicated WAV and MIDI player).
Until now, I've been manually creating short individual MIDI clips with the relevant cc's set to a certain color (say, 127-0-0 for red) and giving the clip itself that same color: sounds a bit roundabout, but it's actually super convenient to keep an overview in the arrangement timeline of what each light is doing at all times, and I can copy clips and move them around and know what color they contain without diving into them. Kind of like a visual light sequencer.


However, editing MIDI cc's manually is quite cumbersome in Live (select clip, pick cc from a long drop-down menu, edit, pick next cc, repeat), and RGB is not the most intuitive way to think about color. So I'm trying to make a kind of "color clip factory" that has sliders for hue, saturation and value, shows the resulting color in real time, converts HSV to RGB, and spits out a ready-made clip with the cc's for the stage lights set to these values (and the clip's own color to match, for visual reference).

The HSV sliders work, the conversion to RGB too, there's an optional Gradient function that adds a different end color to make the lights fade from one to the other.

I've got my cc's ready to go as an output of the decive, now I just need to put them in a clip!
You may use notes instead of cc's which can be put with API into clips,
similar to notes commonly used for articulation switching.
Hey, thanks. So, as I suspected, there's no way to manipulate CCs inside clips like there is for notes?
I'll think about a workaround using notes then...
Or would it be possible for the device to string together a raw MIDI sequence/file containing the cc values, and make it available in a way that I could drag it onto my arrangement like a MIDI file? 🤔 I don't have any experience with that kind of thing, no idea if it's feasible.
The [seq] object can read a text file containing raw MIDI data and generate a MIDI file from it whereat the text file can be created with the [text] object. Notice that the text file uses absolute times (ms) but as [seq] assumes 120 bpm, 500ms correspond to 1 beat in the generated MIDI file.
That's super helpful, thanks!! Now I know where to look. Off to experiment!