Hi,
On Mon, Jul 26, 2010 at 05:15:58PM -0700, saint wrote:
Is there a way to scan a patch (and then it's child subpatches and theirs etc. etc.) and assign a unique consecutive number to each graphical object?
There are some Python-modules to access and edit .pd-files, maybe these can help. Another solution would be to write a wrapper abstraction for your GUIs, that adds a consecutive number by incerementing a global [value] on creation. Your can then replace all objects with a shell/perl/python/... oneliner from http://puredata.info/docs/tutorials/TipsAndTricks/
For example say I have 4 sliders in a patch I want to number them so that the labels now read say 001, 002, 003 and 004 and they now respond to messages sent to r-001, r-002,..etc. and they are now sending information on s-001, s-002,..etc. And also this patch calls upon an abstraction that has 3 toggles and I want them to be labelled, sending and receiving through 005, 006 and 007 etc. etc.
I want to know if I can automate this task so that I can apply it to patches I've already made.
I know I am probably re-inventing the wheel here but I want to do this in vanilla hopefully.
My goal is for any gui parameter to be able to modulate any other parameter (as long as they are of the same type) simply by typing two numbers into number boxes that will link them. A simple modulation matrix of sorts.
Why are you selecting GUI parameters for this? Updating GUIs is still a rather costly operation in Pd (maybe it's better with the 0.43 rewrite), and updating 20 GUIs that you don't even see because they are in a hidden subpatch sounds like a waste. Consecutive numbers don't sound too good to me either. The same logic module can get different receives in every parent patch, which I think is very confusing. And it doesn't work for abstractions at all!
In the rj library (http://github.com/rjdj/rjlib) almost all abstractions have globally accessable control parameters (but no GUIs) by using a sssad-based aproach and [u_dispatch] objects for handling inlet-controls. While this requires some discipline when writing abstractions, it's working pretty well.
Frank