Hello there, today is announcement day!
I can finally introduce the result of one year of research and development! ModScript Lune and its accompanying helper is yet another scripting module for VCV Rack, it uses the Lua language. It focuses on integrating with MIDI controllers and enabling interactions that would be very tedious or even impossible to do with current MIDI modules as per my research (VCV’s, Stoermelder’s etc.).
From the readme:
ModScript’s approach differs from the usual “everything-is-a-module” paradigm: it allows you to write all the MIDI interaction you need using code that is easy to read and write and to remain focused on musical elements in the patch.
It is my opinion and my main drive from the start in using and developing for VCV Rack that MIDI controller interaction in computer music is too often bland and limited to 1:1 mappings between your fingers and the software. Most modern DAWs use some kind of scripting or lightweight code for this purpose, I only hope to help Rack step up to that level too!
The scripts used in ModScript are simple text files that are interpreted by the module directly, they are easy to read and to write. These scripts have the ability to read and write any parameter from any module in your patch, they can also read the values of lights. In Pleine Lune there is also MIDI input and output, you can select the device to use in the right click menu and process the received MIDI messages directly in the script.
This video demonstrates the features of the script I made for the MPK Mini mk3, the intent is to show how PhraseSeq16 reacts to the script, take note how the pads select the step and the joystick toggles the gate types; this is also reflected on the screen by sending SysEX messages to the device, although a little glitchy as the program name is not supposed to be updated on the fly.
Features
- Script auto reload on change, errors and logging in terminal
- Read parameters and lights
- Add and remove cables (experimental)
- Modules and parameters referenced by ids, easily accessible in helper module
- Chose scripts found in the
scripts/
folder in right click menu - Control parameters: normalized (0.0-1.0), raw values, relative to current value (for relative knobs and increment/decrement)
- Library of useful functions (MIDI message type, inspection) and objects (trigger, boolean trigger, pulse generator) and known modules.
- Insanely fast LuaJIT engine, forked from VCV Prototype
ModScript started literally as a fork of VCV Prototype, removing every language except Lua, a lot of code is kept and then I added many functions to the API and features like MIDI i/o.
I am very much into acid and a big fan of the Roland TB-303 and I have created a monster that’s arguably almost as unpractical to use as the original! The script has (almost) everything to never look at the computer: select step, toggle gate, accent, tie and slide for each step, select note with keys, knobs control the synth and filter, select the memory, change waveform, select octave shift, alter notes being played with the keys. Most of it is shown on the screen, current memory, selected step number, gate types and even the note name! The script (~360 lines) is not very complex but the MPK is such a tiny and limited controller that it feels a little extreme to do so much with its limitations!
Helper module
In VCV Rack, every module in your patch is assigned an id. This id is a very long integer and it is needed to reference the module whose parameters you want to modulate; parameters are also assigned a numerical index, starting from 0. The Lune Helper module continuously displays the ids of the modules and parameters you hover with your mouse, it can also copy the module id in hexadecimal notation or its “dump” to your clipboard. This makes it easy to build your script and your patch in parallel and control new parameters as you add modules. The dump button automatically generates the code needed to access parameters with their meaningful names (e.g setParam("Frequency", 0.5)
) instead of obscure indices.
Check out this live coding video I made, starting from a basic example and binding an APC Mini to the excellent Voxglitch Groovebox, speed is 400% of realtime. The result is a script that controls volume, mute, solo and the selected memory, much more could be done!
ModScript is open-source and released under the terms of GPL v3.0 or later, the code is available here: GitHub - Simon-L/ModScript
Acknowledgements
Heartfelt thanks to @falkTX and @dreamer, also big thanks to @heffalump and the overall very welcoming messages in the Development channel on Discord as well as the developers of the wonderful modules featured in the videos: @marc_boule, @slimechildaudio, @clone45, the VCV Prototype contributors and the WrongPeople Lua module.
Since I posted here 2 years ago (!!) and there last year I have remained focused on the integration of controllers in VCV Rack, hopefully ModScript is going somewhere in that regard. Faya, a sequencer module designed specifically for the Akai Fire I am also working on should become available before the end of the year.
I wish I had a beta build to offer, sadly there are still a few bugs and the module needs more testing. I hope this post and the examples will be engaging still. I am genuinely interested in knowing if the community has interest in this like, what controllers do you have? What do you think it could be used for in Rack? So far scripts have allowed me to think big!
I would be very pleased to receive feedback and suggestions here. I hang out on Rack’s Discord server too. Thank you to anyone who read this far!
PS. Please don’t move this to the Development forum, thanks.