voxglitch - development blog

Just for everyone’s record, that’s totally true and I missed it:

Pro tip #1: make plugins in the root of the Rack source repository.

Pro tip #2: CMD="make dist" make plugins in the root of the Rack source code repository.

2 Likes

Ok! I got my modules to show up in Rack 2. Next step, test them one-by-one. I’m optimistic!

3 Likes

All of my modules appear to be working in Rack #2. Do I just set the version and submit it like normal?

Recently on discord

Ah, OK! I’ll just sit tight then. Thanks Paul.

have you pushed your v2 code so others can try it out?

Ah, good point! I had not, but I did just now. You can grab the latest build here:

The changes are on the master branch.

@clone45

Hi Bret - I tried building your master branch (which is now the v2 branch right?) with latest Rack beta (219bbaf1) but I got 2 build errors:

In file included from src/GlitchSequencer.cpp:12:
src/GlitchSequencer/CellularAutomatonDisplay.hpp:165:43: error: no member named
      'zoom' in namespace 'rack::settings'
    double zoom = std::pow(2.f, settings::zoom);
                                ~~~~~~~~~~^
1 error generated.
make: *** [build/src/GlitchSequencer.cpp.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from src/DigitalSequencer.cpp:27:
src/DigitalSequencer/VoltageSequencerDisplay.hpp:192:43: error: no member named
      'zoom' in namespace 'rack::settings'
    double zoom = std::pow(2.f, settings::zoom);
                                ~~~~~~~~~~^
In file included from src/DigitalSequencer.cpp:28:
src/DigitalSequencer/GateSequencerDisplay.hpp:121:43: error: no member named
      'zoom' in namespace 'rack::settings'
    double zoom = std::pow(2.f, settings::zoom);
                                ~~~~~~~~~~^
2 errors generated.

I know some other developers (like Ben Stoermelder for example) have mentioned this issue with zoom being removed from rack settings.

I think you’d have to replace the lines: double zoom = std::pow(2.f, settings::zoom);

with

float zoom = getAbsoluteZoom();

This was the fix that mgunyho did for PdArray modules. Fix zooming in v2 · mgunyho/PdArray@d4795fc · GitHub

1 Like

Hi @steve,

Sorry, I just saw this today. I can take a peek at it tonight!

Cheers, Bret

@steve Ok, this is all fixed and available in the master branch! Thanks @Steve_Russell, your solution was perfect. :slight_smile:

1 Like

Could you rename this thread to something more descriptive. Maybe “clone 45 development blog”?

Sure, it looks like the moderator did that for me. Sorry that the thread got off topic.

2 Likes
void drawLayer(const DrawArgs& args, int layer) override

drawLayer seems to have stopped working for me. The widget where this code exists is a TransparentWidget:

struct CellularAutomatonDisplay : TransparentWidget
{

And the error I’m getting is:

error: 'drawLayer' is not a member of 'rack::widget::Widget'
  106 |    Widget::drawLayer(args, layer);

Any suggestions? Thanks!!

Are you still building against the correct version of the SDK? I think drawLayer was introduced in 219bbaf1

1 Like

Thanks David, that’s what it was. I downloaded the wrong SDK.

1 Like

Has there been any changes to how keystroke event are consumed? In some of my modules, I overrode the left and right arrow behavior in VCV Rack using code such as:

  bool keypressLeft(const event::HoverKey &e)
  {
    if(e.key == GLFW_KEY_LEFT) e.consume(this);
    if(e.key == GLFW_KEY_LEFT && e.action == GLFW_PRESS) return true;
    return false;
  }

Now it no longer works. Instead, left or right arrows shift the viewport and the code above always returns false.

Maybe this was naughty and no longer allowed, which is totally understandable. But if possible, how could I update this code to work with Rack 2?

Thanks!

Intercepting the keys that VCV wants to use is harder than processing other keys. I don’t really recommend it. I do it in my Seq++ sequencer. I just tried that and it still works in the 2.0 port.

btw, that code would be a little nice looking like this:

bool keypressLeft(const event::HoverKey &e)
  {
    if(e.key == GLFW_KEY_LEFT) e.consume(this);
    return (e.key == GLFW_KEY_LEFT && e.action == GLFW_PRESS);
  }
2 Likes

Thanks for the info and recommendation. :slight_smile:

1 Like