Tools for emulating subpatching in Wire
Posted: Sat Jul 27, 2024 19:11
I had a goofy idea recently about a way in which we could emulate subpatching by manipulating Wire files from the commandline. It's really just a proof of concept, not a fully-formed application, but if you're a brave soul comfortable running Python scripts from the commandline, maybe you'll find it useful.
The gist is that you define a subpatch within a Wire patch by putting your nodes inside a Comment node with some special text. Hub nodes that don't have an input connection are considered subpatch input nodes, and Hub nodes that don't have output connection are considered subpatch output nodes. You use one script to extract the subpatch from the Wire patch file, and another script to insert the subpatch into a Wire patch file. When the subpatch is inserted, all the nodes are collapsed visually except for input and output nodes.
Is this better than copy/paste + using the "Align..." functions within Wire? Probably not, but you decide.
https://github.com/moldybeats/wire-subpatch
The gist is that you define a subpatch within a Wire patch by putting your nodes inside a Comment node with some special text. Hub nodes that don't have an input connection are considered subpatch input nodes, and Hub nodes that don't have output connection are considered subpatch output nodes. You use one script to extract the subpatch from the Wire patch file, and another script to insert the subpatch into a Wire patch file. When the subpatch is inserted, all the nodes are collapsed visually except for input and output nodes.
Is this better than copy/paste + using the "Align..." functions within Wire? Probably not, but you decide.

https://github.com/moldybeats/wire-subpatch