Textual patching

I wrote a perl script that allows you to compose puredata patches in a text editor. You define the patch using ASCII art like this:

   *------------------------*
   |           .--------.    \
 .-x--------.  | osc~ 5 |     *
 | osc~ 500 |  `-x------'     |
 `-x--------'    |            |
   |           .-x------.     |
   |           | *~ 300 |     |
   |           `-x------'     |
   *---*         |            |
       |         *------------*
     .-x------.
     | *~ 0.2 |
     `-x------'
       |
       *
       |\
       | *
       | |
     .-x-x--.
     | dac~ |
     `------'

Then run the Perl script over it to produce a .pd file, that you can then load into puredata to get this:

patch.png

The ASCII syntax basically allows you to define pd objects and connect them together. Layout is preserved. Much like in ghostbusters, you can’t cross the lines, and there isn’t syntax for different box types (messages and numbers). Fixing this would be short work, but I ran out of train journey :)

There is a particular syntax for drawing the lines. You use - for going left and right, | for going up and down and \ and / for going diagonally. To change direction or fork a wire you have to place a * . Mark inlets and outlets with x .

I think this shows nicely how there is no real difference between patching and coding. Shades of pixels are an alphabet, anything can be a program if you define a suitable interpreter to go with it.

Sadly you can’t do live patching with this, but perhaps this could be a starting point for thinking about more interesting ways of programming with text.

If you are curious you can download the script (and patch) here.

3 thoughts on “Textual patching

  1. just stumbled across your work after seeing your talk at The Next Layer on video, great stuff and *lovely* perl script.. I’m not a PD user either, but it’s really got me thinking ! thank you

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>