Skip to content

Giving PureData a fresh coat of paint

Gussying-up Pd

PureData – which is a program you should be familiar with if you’ve read a few of my blog posts – comes in two varieties. There is a “vanilla” version which is the one directly from the desk of Miller Puckette. Then there is Pd-extended, which contains a continuously updated collection of all of the best objects created by others for the benefit of the Pd community. Both versions, despite their different names, have the same interface. And compared to it’s cousin, Max, Pd’s visual style leaves something to be desired.

Now I ought to be the last person to complain about this. Pd is a free program with unbelievable capabilities, and I’m constantly proselytizing to anyone who will listen about what an amazing piece of software it is. In fact, truth be told, it’s simple style almost never bothered me before. But alas – after getting to know Pd for nigh-on six years, I have begun to on occasion long for an interface a little less, well, vanilla.

Well I may have stumbled upon a way to give an already amazing program just a hint more visual depth. This method doesn’t flip a switch that will make Pd look like Max, but I wouldn’t particularly enjoy that anyway. What this will do is allow you to customize the color palette for your patches.

You might already be jumping ahead of me and expecting me to talk about how you can use canvases to put some color accents and open up the properties of many different objects to change the colors. This is actually something that will require no additional canvases and will be persistent as long as Pd is open (it must be reset for each new instance of Pd that is started).

Before:

Plain-Jane Pd

 

After:

Fancy-Pants Pd

 

There is an object included in Pd-extended called sys_gui. It’s a part of the hcs library of objects and it allows you to access some of the behind-the-scenes functions of Tcl/Tk, the core framework of Pd. It will work with vanilla Pd, but you will have to download the appropriately compiled object yourself. If you send a message to the sys_gui object in the format “set canvas_fill grey”, it will change the specified object’s attribute to the color provided. There is a help patch in the browser that will show you all of the changeable attributes. If you open the help browser and go down to “hcs” and then “examples” and open up “changing_the_colors.pd”, you will see the attributes listed. As for the colors, I found this page useful: http://www.tcl.tk/man/tcl/TkCmd/colors.htm

You may notice that banging those objects won’t make an immediate change – rather, the next patch you open or create will have the new colors. Because I wanted this to be something I could set on startup and then not worry about, I played around a bit and found that you can create a “launch” patch (which in practice works something like a windows batch file) that activates the sys_gui messages on load so all subsequent patches will have the desired colors. Then instead of opening Pd directly, I make a shortcut to the launch patch. This actually kills two birds with one line of code because this will also make the default directory when you try to open an existing patch wherever the shortcut lives. I had been trying to figure out recently how to make the default project path different than the program directory and this does it without messing with the any of the configuration files, which I forgot how to change properly long ago.

 

I know. Writing this makes me a shallow person. Shallow, superficial… but resourceful.