Connector for Ports in Surge/AW/etc... and how you can use it

Hi Friends!

As some of you may have noticed, the current version of SurgeXT and Airwin2Rack have right mouse buttons on the inputs and outputs that allow you to connect to neighboring modules and to mixmaster. And if you run the surge or air windows nightlies, and have updated in the last hour, these menu items are quite a bit expanded.

Anyway I wrote the code to do this in a pretty general way thinking that other modules could use it. I’ve dropped it initially into BaconPlugs also and will probably get to mschhack shortly.

And I’ve made all the code available as a C+±17 header only MIT-licensed (not GPL3; MIT - so you can use it in closed source rack modules!) library called sst-rackhelpers.

The library contains a few tricks I use when dealing with the json api, and also the incredibly-useful-to-me frame-buffer-widget-on-a-lambda class I use basically everywhere. But the main thing folks here will want is probably the connectivity.

The README in the repo provides the full documentation but the core idea to get all the right mouse shenanigans is

  • Replace your Port class with our CRTP-mixin on the port class. So createInput<MyPort> becomes createInput<sst::rackhelpers::module_connector::PortMixIn<MyPort>>
  • Set some properties on it for mixmaster
  • If you want to participate in neighbor connectivity, implement a virtual class to advertise named port pairs
  • Build, test, ???, Profit.

Anyway I was going to explain it all here but instead just did a push to the README on GitHub. Please take a look there if interested, but we can also use this thread or issues on the GitHub for discussions.

And as always, happy to welcome any or all comments. We run surge projects as open contribution and are happy for people to add and change things and upstream them. The only thing we can’t change now is the ABI stable API point, but we could expand it via subclassing easily.

Look forward to hearing your comments!

7 Likes

Oh and also: We really are open contribution! The idea to even do this at all came from contemporaryinsanity and VCVRackIdeas over in More Advanced Auto-Hookup Options (was Expanders are Implicit Connections) · Issue #829 · surge-synthesizer/surge-rack · GitHub and although we ended up in a different place (including some color stuff which DaveVenom and I chatted about, and slightly less automatic than those original ideas), wanted to say thanks to both!

2 Likes

Not anywhere near an expert, but won’t C++17 have potential issues with Racks C++11?

Thanks, It’s been a pleasure.

Paul is a delight to work with, so if anyone has any ideas to contribute, don’t hesitate.

1 Like

The toolchain supports 17 just fine and has for a couple of years. The readme explains how to set 17 in your rack make file

1 Like