Newb Panel Generation Questions

SamplePlayer.cpp (971 Bytes) SamplePlayer

Hi, I’m trying to create a basic module that triggers an audio file. But I have a couple of major issues:

  1. When I add the plugin logo as both a png and a bmp to the SVG file, it doesn’t appear in the built module, it’s just a blank panel with screws
  2. The components aren’t added in the SamplePlayer.cpp file, there are no addOutput, addParam etc at the bottom of the file. When i run the helper.py script again, i get the following warnings:
$RACK_DIR/helper.py createmodule SamplePlayer res/SamplePlayer.svg src/SamplePlayer.cpp

Module SamplePlayer already exists in plugin.json. Edit this file to modify the module manifest.

src/SamplePlayer.cpp already exists. Overwrite? (y/n) [n]: y

Found 0 params, 0 inputs, 0 outputs, 0 lights, and 0 custom widgets in "components" layer.

Here is my plugin.json file:

plugin.json (470 Bytes)

Maybe I just have to start again, and I don’t mind adding everything manually, I gather this is more reliable, but I’m not sure of what exactly to write, and I’d rather troubleshoot my tools for the next time. Any help is greatly appreciated.

Did you name the layer with controls on?

The helper.py script can help you get started the first time, but it’s a very limited tool. You can’t update existing code with it; it will overwrite your existing code if you let it. My sense is that most developers quickly abandon helper.py once they start getting their first module working.

Rack offers useful but limited support for SVG rendering. I don’t believe it can handle PNG or BMP images embedded inside the SVG. You will need to create your logo as vector art.

To understand exactly what Rack’s SVG renderer can and cannot do, take a look at the source code file Svg.cpp, especially in the function svgDraw. It mostly handles shapes, paths, linear and radial gradients, and basic colors.

Also take a look at the Panel Guide document.

2 Likes

I can confirm that this is true. It is possible to render a second .png or .jpg “layer” to your module’s panel, but it’s quite involved and rarely done. But as Don suggested, if you can convert your logo to vector art, you’ll have a much easier time.