I run VCV Rack on a fairly low performance laptop (by current standards). I can’t run Rack and a DAW at the same time, so I can’t just stream MIDI out of Rack and record it in my DAW. I suspect I’m not alone. So I decided to write a MIDI Recorder module. This module lets me capture 10 tracks of MIDI into a standard MIDI file and then import it into my DAW.
I haven’t submitted this to the Library yet - pending feedback from y’all…
A multi-track recorder to capture a VCV performance to a standard MIDI file. Supports up to 10 polyphonic tracks, capturing CV in the same way the VCV core CV-MIDI module does.
Each row of inputs corresponds to one track of MIDI.
RUN - If the GATE input is unconnected, you can press this button to start and end the recording. It changes color to red while recording.
GATE - You can control the recording start/stop with a gate signal (e.g. from Count Modula’s FADE module). Recording starts when the signal is above 0.0v; stops when it drops to or below 0.0v. The Run button turns red during recording.
BPM - Use this to set the tempo of the MIDI file. Uses same conventions as Impromptu’s CLOCKED BPM output (BPM = 120 * 2^voltage). If unconnected, sets the MIDI tempo to 120 BPM.
The remaining inputs accept the same signals that the VCV core CV-MIDI module, each row feeding a separate polyphonic track in the target MIDI file:
V/OCT - polyphonic. Note pitch (1V/oct)
GATE - polyphonic. Note gates (0 … 10V)
VEL - polyphonic. Note “velocity” (0 … 10V). Defaults to 100 if no input.
Target file selection works in a similar way to the VCV Recorder module. You can select a file from the context menu, or if none has been selected, you’ll get a popup dialog the first time you try to record something:
Output File - the path to the target MIDI file to be produced.
Append -001, -002, etc. - If checked, the recorder creates unique files if the target file already exists (/my/file.mid, /my/file-001.mid, /my/file-002.mid). If unchecked, the file is overwritten.
Start at first note gate - when checked (the default), even after the recording is “started”, the recording is delayed until it sees the first note. This ensures that the resulting midi events are aligned to the beginning of a bar. This also means that any non-note events (PW, MW, AFT) will be ignored until that first note plays. Turn this off to record the events immediately (in which case you may need to shift the events in your DAW to get them to line up nicely on a bar division.
Had a quick test and output itself worked with seperate tracks and both poly and mono gate/cv pairs.
I have to take another look at the BPM setup cause I didn’t get it to work with the “BPM” out of Clocked (Midi files were endlessly long, like 7000 Bars at 72BPM instead of 20 or so).
Also I stumbled into one crash when trying to patch the RUN output of clocked into the gate input to trigger record.
This was the patch I used.
Thanks for testing! I’ll take a look at your patch and see what I can learn re: the RUN crash. Please send me the contents of your Rack log (~/Documents/Rack2/log.txt) - it may have a stack trace that sheds some light on the bug.
FWIW - BPM is just intended to set the “tempo” metadata in the MIDI file - it does not affect the length of the file - the recorder will record as many events as it sees (even if they are repeating) as long as it is “running”.
First thing I notice in the patch is that the recorder’s BPM input is connected to Clocked’s CLK output - it’s intended to be connected to Clocked’s BPM output. I can see why you would expect a clock gate to supply the BPM, but that’s not how it (currently) works. Open to discussion if it’s important to support a direct CLOCK input instead of the encoded BPM input.
Awesome idea. Will give this a go. I tend to use VCV to generate midi cc as well and recording those would be neat. Maybe an expander module that supports recording 8-16 midi cc per track would be perfect, allowing configuration for which midi cc’s to be recorded in the resulting file(s).
The problem will be more to have a MIDI receiver/instrument (since the MIDI recorder will produce a MIDI file with 14bit CC - and we’ll need a way to validate that produces something that a DAW - non-VCV instrument handles correctly.) I haven’t checked if any of my VST/AU’s handle 14bit - likely something does, but until I can be sure I’ll probably ask that others help validate.
@Chinenual I can confirm everything works as intended once I hooked up CLOCKED like you suggested (BPM out). No crash so far either.
The module successfully recognized bpm and the midi files where correct inside the DAW. There was a little drift, so notes that should have played “every bar” weren’t 100% on beat (increasingly behind). But I think this is something that has come up here in the forums a couple of times and is to be expected?
I’ll need to think on the drift issue. I know there’s been some comments in the forum that suggest that Clocked BPM may not be 100% identical to some DAW’s BPM, but I’ve not looked into that. I’ll review the way the recorder computes the MIDI “tick” – there’s some float->integer rounding going on there that may be introducing some extra timing inaccuracy - but I would expect that to be distributed plus and minus the true time - would not expect it to produce a drift in one direction…