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>
becomescreateInput<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!