automatically initialize midi controllers with mapped parameter values

aleksuuu's icon

Hello! I wrote a JS tool that sends initial values of all mapped parameters back out to a MIDI controller as CC messages. This can be pretty useful if your controller responds to MIDI input (i.e., motorized faders, LEDs, etc.). I've tested it with my Midi Fighter Twister, and it works pretty well.

You can find the script as a GitHub Gist here. It does use modern JS syntax, so you'll have to use v8. The loadbang() function will send out all mapped values when the patch is opened, or you can send a bang to v8 to manually trigger the output. Connect the outlet to the leftmost inlet of ctlout.

P.S. I'm also wondering if there's a (not too hacky) way to send out current values of all mapped parameters. I'm getting the initial values by directly reading the .maxpat file, but the current values are not stored in the file as far as I understand. Suggestions welcome!