Selectively ignore modules in VCVRack when exporting a yml patch file

Hi,

The Goal

I would like to be able to work on building Metamodule patches in VCVRack and also run an FX & mixing VCVRack patch at the same time to process the audio coming back from my Eurorack case. I could then iterate on the MM patch (using the Wifi expander) + the Eurorack + the final end-of-chain VCVrack FX & mixing all at the same time.

The Problem

This is not possible at the moment afaik, because the VCVrack Metamodule will include all (well, most) modules from the VCVRack patch (including the FX + mixing module section) in the exported vcv patch.

In the example below, the yellow section is the Metamodule patch, and the green section is the post-Eurorack FX + mixing section. Note that it just happens that the FX section contains some modules (e.g. Valley Plateau, because reverb is life) that also exist on the MM (and so would not be automatically “ignored” when loaded onto the MM)

1x8-1x4V2-Scapeshift MIDI audio mix.vcv (8.5 KB)

Possible Solution

@danngreen How about this is a solution?:

  1. Create a no-op “Look The Other Way” / blank 4MS VCVRack - only module
  2. Place instances of this module to the left of sections of a VCVrack patch on each row that you want to hide modules from the Metamodule.
  3. When the VCVRack Hub module iterates over the modules in a VCvrack patch to add them to its internal list of transferable modules when saving a YML file, it should skip all remaining modules on that row once it encounters a “Look The Other Way” module. (I think the PatchWriter class code that does that is here: 4ms-vcv/src/mapping/patch_writer.cc at 9a60809bbddac555d050212977014e478ccd1c14 · 4ms/4ms-vcv · GitHub).

I could even have a go and do a proof of concept of this myself, but would really appreciate a sanity check from 4MS and the community first. Is this a problem others have encountered, or have solved in another way?

One possible alternate solution would be to only use modules in the VCV section that are unavailable on the Meta. But I can see how that might be unsatisfactory and having a way to tell the Meta Hub to skip some modules would be helpful for your use case.

there was only 1 time when i had to do something like this and i just ran 2 instances of vcv standalone. 1 instance contained only the mm patch, and the other had all the non mm patch stuff in it.

running 2 instances with vcv pro plugin is super easy, but with free standalone you need to do a little voodoo to make it work:

windows- use a free sandbox app and install/run the 2nd instance from within there
osx- you have to use terminal and “open -n VCV Rack” command

I think that would be a fine solution. Also willing to hear more, as the “look the other way module” might not be obvious what it does without understanding the MM workflow.

Another idea to consider, at some point I thought it would be nice to scan all the cables and determine if a module is patched, directly or indirectly, to the MetaModule hub that you clicked “Save” on. That should produce the same result in your screenshot at least, since all the modules in the yellow box have a cable that eventually reaches the hub, and all the modules in the green box do not.

But it wouldn’t let you ignore a module that’s patched to a connected module, whereas the “Look the other way” module solution would let you do that.

On the other hand, checking for connectivity would let you have multiple MM Hubs in a patch, and each one could export just a subset of the overall VCV patch. This could be handy if you had multiple physical MetaModules and wanted to create patches that involved them all. Or if you wanted to make several variations of an idea within the same patch file, and export them without open/close/save the VCV files.

There could be a menu setting for the hub like “Patch all modules/Patch connected modules only.”

A more elaborate version that would solve the problem Dan just identified would be “Patch connected modules only, ignoring [red/yellow/blue] cables.” Maybe that’s too elaborate? Kind of fun though.

I wonder if you could piggyback off the VCV rack “selections” functionality?

1 Like

Hi,

Yes, we could use the expander - navigation technique of the Stoermelder Strip module to select all modules joined to the left or right of a MM hub module in the same rack row.

That would easily allow multiple hubs in the same vcvrack patch. Only downside is that all modules in one hub patch must be in a line on one Rack row attached to a hub module. It could be an option when clicking the Save and wifi buttons ? “All modules in the patch”, “Connected modules to the left”, “Connected modules to the right”, “Connected modules to left&right”.

I use Strip for this all the time (“Voice” strips, “FX”, “Utility” strips), and it works just great.

I have a working proof of concept of the idea suggested by @CountModula , replacing this code in the vcv_patch_file_writer.hh with this instead:

		// Add modules joined to the right of the hub module
		auto* module = engine->getModule(hubModuleId);
		while (true) {
			if (!module) break;

			int64_t moduleID = module->getId();
			if (ModuleDirectory::isRegularModule(module) || ModuleDirectory::isHub(module)) {
				auto brand_module = ModuleDirectory::convertSlugs(module);
				auto moduleWidget = APP->scene->rack->getModule(moduleID);
				if (moduleWidget) {
					moduleData.push_back({moduleID,
										  brand_module.c_str(),
										  moduleWidget->getBox().getLeft(),
										  moduleWidget->getBox().getTop()});
					if (module->model->slug.size() > 31) {
						pr_warn("Warning: module slug truncated to 31 chars\n");
					}
				}

				if (!ModuleDirectory::isHubOrExpander(module)) {
					for (size_t i = 0; i < module->paramQuantities.size(); i++) {
						float val = module->getParamQuantity(i)->getScaledValue();
						paramData.push_back({.value = val, .paramID = (int)i, .moduleID = moduleID});
					}
				}
			}
			midimodules.addMidiModule(module);
			expanders.addModule(module);

			if (module->rightExpander.moduleId < 0) break;
			if (!module->rightExpander.module) break;
			module = module->rightExpander.module;
		}

It steps through each “right expander” module until the rightmost module doesn’t have an expander itself (NB: here, rightExpander just means there is a module positioned next to the current module without a gap in between). Multiple hub “strips” in the same VCVRack patch work too!

Hi @danngreen I know you guys are in Superbooth this week, but here’s something to look at when you return to base … Selectively ignore modules when exporting a yml patch file by rjsmith · Pull Request #39 · 4ms/4ms-vcv · GitHub

The PR adds three new module selection modes in a context menu that only select modules directly placed in a line next to a Hub module (in the same way as the Stoermelder Strip module works, Left&Right, Left Only or Right Only).

As a side benefit, it also allows one VCVRack patch to have multiple Hub modules that export different attached module chains (each Hub module instance can have a different module selection mode).

3 Likes

Very cool, I look forward to reviewing this!

1 Like

This is absolutely brilliant.

def would be a useful way to prototype a bunch of mm patches in a single vcv patch, for those of us without vcv rack pro plugin. and using the “strip” module by stoermelder, one can bypass whole swaths of modules at once in vcv, also useful for prototyping a ‘playlist’ of patches..

Strip Module-1

Yeah,I’ve already been using the Strip module to save a MM module chain (with a hub module) as a selection, so can paste it into other .vcv racks.

And to mash the Strip’s randomise button then ping it over to the MM ! The Strip is ignored by the MM of course (although u do see that warning on the module, wonder if there is a way to suppress that?).

Yeah, I have wished for a way to whitelist utility modules that I always use in VCV to prevent that warning from appearing on the Meta. This “right/left only“ feature would solve that, although maybe not for Strip if you use that.

here’s hoping that someday we could even possibly see a module like ‘strip’ working in mm.. so you could toggle bypass chunks of modules in a single yml saving cpu use.

Couldn’t you do that with a switch?

on the mm, you cannot bypass modules and turn off their cpu use.. yet

Oh I see, I just meant you could take them out of the signal path.

i think a bypass option on mm would ideally function just as it does in vcv. so a vco running through a reverb, then bypassing the reverb, would both turn off the reverb’s cpu as well as let the vco run through it

1 Like