Plugin doesn't show up in Rack

Hello -

I’m trying to play around with creating a plugin. I have gone through the tutorial (which worked as advertised), and now I’m trying a small modification of that. However, after all is done (compiling, and running make install), the new plugin has been moved to the correct directory, but does not appear in the module list.

I assume that the plugin.json file is what is used to read in the information for the plugin; it is basically the same as the tutorial one, but with different names.

Is there something simple I am doing wrong?

Try this:

Here is plugin.cpp:

#include "plugin.hpp"
#include <stdint.h>

Plugin* pluginInstance;

void init(Plugin* p) {
   pluginInstance = p;

   // Add modules here

   // Any other plugin initialization may go here.
   // As an alternative, consider lazy-loading assets and lookup tables when your module is created to reduce startup times of Rack.

and plugin.hpp:

#pragma once

#include <rack.hpp>

using namespace rack;

// Declare the Plugin, defined in plugin.cpp

extern Plugin* pluginInstance;

// Declare each Model, defined in each module source file

extern Model* modelLofi;

(As I mentioned, they are basically just the ones directly from the tutorial)

Still hard to say. Maybe you should take a look at log.txt.

Always look at the log/console for issues. Logging is pretty verbose, so you should see a WARN line somewhere.

maybe if you like to share your code on github with us we can help you out. At least I’d give it a try

1 Like

Ah, the log is useful. I did not look there. The relevant line was:

[0.106 warn src/plugin.cpp:158] Could not load plugin /Users/simonrose/Documents/Rack/plugins-v1/LofiAudio: Manifest contains module LofiAudio but it is not defined in the plugin

and the issue ended up being that I had written

Model* modelLofi = createModel<Lofi, LofiWidget>("Lo-fi");

instead of

Model* modelLofi = createModel<Lofi, LofiWidget>("Lofi");

(I did not realize the value in the strings was supposed to match the module name…)

Thanks for the help!

It’s not the module name, it’s the module slug.