Chinenual Development Thread

Announcing: a new MIDI Recorder module.

MIDIRecorder

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…

You can grab a copy of the beta here: GitHub - chinenual/Chinenual-VCV: Modules for VCV Rack

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.
  • AFT - polyphonic. Aftertouch/Key Pressure (0V … 10V)
  • PW - monophonic. Pitchbend (-5V … 5V)
  • MW - monophonic. Mod Wheel (0V … 10V)

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.
14 Likes

Fantastic Module Idea :slight_smile:

2 Likes

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.

MIDI REC Test Patch_07-26.vcv (3.3 KB) Hope that helps.

I am testing on MAC OS 10.15, Rack 2.1.2 and latest Build c4422a6

1 Like

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.

Ok so that’s sounds like an error on my side. Will recheck (also for the log)

I’ve built a new beta (2.0.0b2) that adds an LED-style display of the BPM. Hopefully that will help catch misconfigurations of the BPM input.

MIDIRecorder

1 Like

By the time you see this there’s already a 2.0.0b3. No functional changes, I just rearranged the layout of the BPM and GATE inputs so that the BPM display and BPM jack are now next to one another.

1 Like

I’ve fixed a bug related to the module browser - very likely the crash that @aetrion-music reported earlier in this thread. Version 2.0.0b4

Hopefully we’re converging on something releasable :slight_smile:

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).

1 Like

I like the idea of an expander for CC. I’ve also wondered if there’s any appetite for more than 10 tracks of MIDI.

I’m just wondering if the CC output can support 14 bit encoding, using low CC and high (+32) CC.

I played with it a while ago, on Raspberry Pi Pico and Teensy (link) ADC into rack.

I haven’t kept track on the 14 bit midi input support in VCV Rack / 3rd party modules, I got sidetracked using OSC.

But just thinking it would be nice to be able to export 14 bit midi CC :slight_smile:

1 Like

I think I should be able to support 14 bits (not sure I have any instruments to test with, but will enlist your help :)) Will add that to the wishlist for the CC expander.

Here’s a simple Puredata 14 bit midi sender I just made, you can use loopmidi on windows to connect it to VCV.

MIDI_CC_14bit.pd.txt (850 Bytes) rename to .pd

1 Like

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?

1 Like

@aetrion-music - great! Thanks for testing.

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…

1 Like

I know that U-He Repro-1 can use 14 bit controllers - perhaps a demo is available. edit: it is available, only “The demo version emits crackling sound at irregular intervals.”

Repro: Two classics, recreated | u-he

and 14-bit midi is recorded by ableton - see screenshot (CC 1+33) I could export as midi file if that’s any help.

and the repro-1, after midi-learn of the puredata midi output from above patch to control filter cutoff.

1 Like

Looks like Logic’s ES2 supports 14-bit, so I’ll probably be able to sanity check things directly in Logic and ES2.

I’m holding off on starting the CC expander until the core functionality is solid and published in the library - but will follow with the CC expander Real Soon after that.

Building a midi-player too ?