VCV Rack Crashes After Following Plugin Development Tutorial

Hello,

I’m interested in porting over some DSP code I’ve written for embedded processors over the last couple years but I’m struggling to successfully compile the tutorial module on the VCV site (this one: VCV Manual - Plugin Development Tutorial).

Compilation isn’t necessarily the issue, rather, what happens after compilation:

  1. An issue with the helper.py script not grabbing the correct coordinates from the .SVG file. This leads to things being placed incorrectly on the front panel.

For example, the LED in the example is located here:

But the code places it in the wrong place:


		addParam(createParamCentered<RoundBlackKnob>(mm2px(Vec(5.161, 15.6)), module, MyModule::PITCH_PARAM));

		addInput(createInputCentered<PJ301MPort>(mm2px(Vec(5.161, 26.239)), module, MyModule::PITCH_INPUT));

		addOutput(createOutputCentered<PJ301MPort>(mm2px(Vec(5.161, 36.817)), module, MyModule::SINE_OUTPUT));

		addChild(createLightCentered<MediumLight<RedLight>>(mm2px(Vec(5.161, 8.741)), module, MyModule::BLINK_LIGHT));

Here is the output in VCV rack - the components are not correctly placed:

image

  1. The second and more major issues is that the module runs the first time after make install but then crashes if you delete the module. Then it crashes VCV Rack every time it loads.

image

I’m running on a Windows 64 bit machine, using msys2 and MINGW64. I downloaded this version of the SDK:

don’t know what’s going on here, maybe someone will.

us “old timer” don’t use that python script, because it didn’t exist “back on the old days”.

You don’t need to use it. I have a repo called “demo” that shows how to make minBLEP vcos, but the first version is super simple and makes the module entirely in code: GitHub - squinkylabs/Demo: A collection of code and articles of interest to VCV users and developers.

1 Like

Is this demo for a module that can be used in VCV Rack 2?

I don’t remember. Let me look… …it look to me like the default main branch is for 1.x, but there is a branch called v2 for 2.0. Perhaps I should merge that branch and make sure everything is ok, now that 2.0 is out.

But I’m pretty sure it works.

2 Likes

looks ok. btw, the articles over on that repo are pretty good (imao).

… we had to punch the machine code onto paper tape, then toggle switches on our computers to boostrap the paper tape reader…

4 Likes

On the helper.py issue, are you doing any transforms in Inkscape? It doesn’t parse them (see a few posts starting here) which can result in things getting misplaced (although there could be other reasons. (Like @Squinky I don’t use helper.py, which definitely isn’t necessary, but I can see the convenience).

I didn’t touch the SVG file at all. I was just using the default file from website. I dug into helper.py a little bit and tried to figure out why my components were being scaled. I think I may have found something though. I don’t often use the re library or regex but I wonder if the issue has to do with the ‘scale’ parameter in helper.py

The variable root_width is a floating point number (30.48mm in my case) and I wonder if this expression only accounts for decimal/whole numbers:

if re.match(’\d+mm’, root_width):

Here is the broader snippet where that code comes from:

def panel_to_components(tree):
	ns = {
		"svg": "http://www.w3.org/2000/svg",
		"inkscape": "http://www.inkscape.org/namespaces/inkscape",
	}

	root = tree.getroot()
	# Get SVG scale relative to mm
	root_width = root.get('width')
	if re.match('\d+mm', root_width):
		scale = 1
	else:
		svg_dpi = 75
		mm_per_in = 25.4
		scale = mm_per_in / svg_dpi

If I force the ‘else’ statement to set the scale = 1, the module ends up looking just fine: image

Still crashing when the module gets deleted though :smiley:

I’m not married to the idea of sticking with helper.py …! I just want to get started and this is the route the VCV Rack site sent me down. Any other approaches/guides are much appreciated.

Ah! Sorry, I read your post too quickly and didn’t get that you were using the tutorial files. If there’s an error in those it should definitely get fixed ASAP!

On a glance I think you might have found the issue already in the re; nice work!

As to other approaches, what a lot of people do is either figure out all of the coordinates by hand or use a bunch of LEFT_MARGIN and PORT_SPACING type local constants to make things easier to tweak.

I’ll try to repro the crash in a bit (as well as double-checking the Inkscape thing to corroborate your findings). Do you have an easy way (github etc.) to post the final code you’re compiling that causes the crash?

Welcome to the forum, by the way! :slight_smile: Once the toolchain stuff is sorted out, I’m looking forward to hearing what your DSP ports are (if you’re planning on making them public, that is).

1 Like

Yes! I think I ran through the tutorial a dozen times now so I don’t think I’m missing anything but who knows. :sweat_smile: On another note, i think I fixed the regex expression to account for floating point numbers by using the following:

	if re.match('[+-]?([0-9]*[.])?[0-9]+mm', root_width):
		scale = 1

Seems to work OK (See screenshot below). Note sure where this is being repo’d but if that is the issue and someone could review and fix it, that would be great.

image

Yes I’ll try and commit something to GitHub tomorrow for others to review.

Is there anywhere where I can grab a crash report or something to help diagnose why I’m getting the following error when I open VCV Rack? It has to be associated with the module I’m compiling, because when I delete it, it stops showing up.

image

If you run from a command line the crash info will be in the console. Otherwise it’s in the log file.

1 Like

Yes, I have used both of those methods, but not in many decades.

2 Likes

I position everything with Adobe XD, then copy all the absolute positions from XD to my code.

1 Like

You should use the latest SDK, not the old beta one

https://vcvrack.com/downloads/Rack-SDK-2.0.0-win.zip

3 Likes

Don’t remind me of JCL, oh the horror, far worse than punchtapes/card decks im my book

JCL on a punch card deck with in-stream DD containing your Fortran IV program and another in-stream DD for the input to said program which you had to hand in to the computing centers front desk, and the results of which you could pick up as a stack of chain printed fan-fold zebra paper the next day. The horror indeed. Especially if you had a syntax error in your JCL or Fortran IV program and had to do it all again.

urgh, yeah, and don’t drop the card decks, ever!

Thank you Jens!! this fixed both my problems! No more crashing and the tutorial plugin runs as expected. Now I can actually get started!

Glad I shared the version of the SDK I downloaded. The list of files in the downloads is so long and I totally missed it.

2 Likes

Paper tape? HAH! Lucky you, we didn’t have those luxuries. We had to carefully move a magnetized needle in front of the core rope memory. Ah… those were the days :slight_smile:

Me thinking: Man! There’s gotta be an easier way, this just screams for better tooling …

2 Likes