helper.py enhancement

Yes but expose the whole API so you could do a UI scripted too.

1 Like

Iā€™ve been using a custom ā€œeditor moduleā€ that can attach to any other module, modify positions of widgets and save the layout, which the modulewidgets can load later. This way it is possible to switch between positioning/scaling knobs, ports etc and testing them without recompilation or restarting Rack. But adding new params still needs a make.

3 Likes

Sounds very interesting. Something you made? Something you can share?

Itā€™s something I made for Rack 1, but havenā€™t touched since v2. My modules still use the layout files, but the editor module isnā€™t ported to v2 (as Iā€™m not working on new modules rn) and it isnā€™t isolated from my plugin enough to be easily reused or shared.

Maybe some day Iā€™ll make a separate repo for it or someone gets inspired enough to make it in a better way.

Hereā€™s an old gif of it in action.

9 Likes

Interestingā€¦ is it just for placement of widgets or?

Yes but eventually it would be cool if it could create lines, basic shapes and text labels as well for designing simple panels completely.

2 Likes

Iā€™ve only made the two modules, but I definitely use Inkscape. And thus helper.py, if only to figure out where the dots ended up. The ease of using Inkscape/helper.py definitely helped convince me to start developing my plugin in earnest, so Iā€™m grateful for it.

basically, extend it to be a full screen design tool, with all the features that other top tier screen designers (sketch ,figma, affinity designer, XD) have? sounds ambitious.

That might be too far, mainly three tools from such programs is needed: being able to place rounded rectangles, bezier curves and text in relation to ports and knobs/buttons.

Itā€™s common you want to connect ports or knobs representing some signal flow, or put boxes behind outputs etc. I found reordering these either with code or in inkscape to be a hassle. Of course fancier graphics and components themselves would still require the programs you mention.

Since we have names for everything now (meaning both for params and ports), it could use these names for example to automatically add labels (with optional string shortening like ā€œclockā€ ā†’ ā€œclkā€) which would be great to get a ā€œworkingā€ panel fast and to avoid mismatching params in code with graphics.

Many panels donā€™t need more than these basic things and once those are working, ambitious features can be added like drawing circles :yellow_circle: in case a fully rounded square wasnā€™t enough :slightly_smiling_face:

1 Like

I use Inkscape and helper.py for almost all my modules.

Itā€™s value for me

  1. Creating a working shell of a module when I was first starting out.
  2. Locating and copying the x,y coordinates from Inkscape.

Where it needs improvements:

  1. Its not designed to update module positions
  2. It incorectly places things sometimes because it canā€™t handle rotatons on the circles or translations on the component layer.
  3. It misses compnentes that are not circles (happened to me in accident)

How I would improve it:

  1. Split the coordinates into its own hpp file and give the tool the ability to update only that.
  2. Warn when itā€™s generating coordinates off the panel.
1 Like

The code for this is mostly implemented in helper.py, I tweaked it a bit and it worked well. If you want a copy, Iā€™ll send it to you.

However, I really hardly used. Now I just start with a large blank panel, and copy/paste/edit from my other code.

Yes, this is what I call ā€œthe normal methodā€. I had a slight refinement I had a module called ā€œblankā€, and would clone that first thing. Same idea, though.