Sorry to be so rude as to reply to my own message, but I have thought more about Frank's original message since my first reply.
I am beginning to see that it might not be a good idea to expose all
those receives, even if the likelihood of name-collision is small. If
all patches were designed this way, there would be a great many possible
collisions, so the likelihood would increase, even with careful naming.
It would be difficult to track down, too. The more I think about it,
this should be an anti-pattern for PD.
It is very tempting to do things this way because PD send/receives are a convenient and clean way to map a large number of parameters.
I have been thinking about an alternative anyway, which is for [polyWaveSynth] to have one message inlet which accepts OSC-format messages, parses them with OSCroute and sends them to the appropriate targets. It's slightly less efficient, but much more encapsulated, and suggests some interesting new capabilities, too...
Phil Stone wrote:
Hi Frank,
The [r $1-something] receives are exposed to the outside by design, so that all parameters can be controlled programatically and not just by the sliders and controls of the UI. They also permit multiple synthesizers to be separately addressable. Finally, $1 serves as the prefix for [sssad], so that multiple [polyWaveSynth]s can have their state saved or restored simultaneously. In my current setup, I use two [polyWaveSynth]s, and all my presets contain values for both synthesizers.
If one chooses $1 wisely, for instance "wav1", the likelihood of name collisions is not great, I think, as the resulting receives look like "wav1-atk" or "wav1-freq". I understand what you're saying about conservation of namespace, though, and I did try to use $0- whenever possible, like in the [polyWaveVoice~] patch.
Thanks for writing,
Phil
Frank Barknecht wrote:
Which reminds me of another issue in your synth: You are creating a lot of global sends and receives with it by using [r $1-something] all over. I think it is possible to change most of these to [r $0-something] and effectively hide them from the world outside of polyWaveSynth.pd This would lower the risk of accidentally reusing one of these names in another abstraction (whose author may be somebody else).
Ciao
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list