Hi there,
I want to create an abstraction with a dynamic number of iolets. By default it should require one argument and have one outlet. If more arguments are present, then it should create one additional outlet for each additional argument. My understanding is that in order to do that I need [iemguts/initbang]. Now, I wouldn't want to add iemguts as a compulsory dependency to my abstraction library and so I would want to make its use optional, so that the single-argument version still works without it. Here are my requirements:
1- if single arguments and iemguts it not available, it shouldn't print iemguts/initbang... couldn't create, as that would be disruptive
2- if multiple arguments and iemguts is available, it should use it
3- if multiple arguments and iemguts is not available, it should print a meaningful error
and optionally:
4- in case 3, it shouldn't print iemguts/initbang... couldn't create alongside the meaningful error
If I didn't care about 1, it would be very straightforward: just hardcode a single outlet and then create more as needed if iemguts/initbang is available. But, as I do care, is there some way to suppress the couldn't create message, or detect the availability of iemguts before instantating it (all at init time, which may be complicated), or - perhaps more simply - to have some vanilla way of sending an initbang?
Thanks, Giulio
Hi,
I haven't thought about your whole problem, but maybe this can help to avoid 'couldn't create' errors:
you can add a "fallout/" subdir in your project, that would contain a initbang.pd abstraction, doing whatever suits you. Then in the patch needing [initbang], you add a [declare -path iemguts -path fallback], so the iemguts/ directory has precedence over fallback/. Then you can use [initbang] (without the path) 'safely'. Attached is a short example.
Le mer. 31 déc. 2025 à 15:29, Giulio Moro via Pd-list pd-list@lists.iem.at a écrit :
Hi there, I want to create an abstraction with a dynamic number of iolets. By default it should require one argument and have one outlet. If more arguments are present, then it should create one additional outlet for each additional argument. My understanding is that in order to do that I need
[iemguts/initbang]. Now, I wouldn't want to add iemguts as a compulsory dependency to my abstraction library and so I would want to make its use optional, so that the single-argument version still works without it. Here are my requirements: 1- if single arguments and iemguts it not available, it shouldn't printiemguts/initbang... couldn't create, as that would be disruptive 2- if multiple arguments and iemguts is available, it should use it 3- if multiple arguments and iemguts is not available, it should print a meaningful error and optionally: 4- in case 3, it shouldn't printiemguts/initbang... couldn't createalongside the meaningful errorIf I didn't care about 1, it would be very straightforward: just hardcode a single outlet and then create more as needed if iemguts/initbang is available. But, as I do care, is there some way to suppress the couldn't create message, or detect the availability of iemguts before instantating it (all at init time, which may be complicated), or - perhaps more simply - to have some vanilla way of sending an initbang?
Thanks, Giulio
pd-list@lists.iem.at - the Pure Data mailinglist
https://lists.iem.at/hyperkitty/list/pd-list@lists.iem.at/message/BYUF2ROQRE...
To unsubscribe send an email to pd-list-leave@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.iem.at/
Em qua., 31 de dez. de 2025 às 11:40, Giulio Moro via Pd-list < pd-list@lists.iem.at> escreveu:
or - perhaps more simply - to have some vanilla way of sending an initbang?
I agree this is something that should belong to Vanilla. I had a PR for adding both [closebang] and [initbang] that had conflicts, see https://github.com/pure-data/pure-data/pull/616
I made a new one for [closebang] and will find my time now to add yet another just for initbang (I don't remember having a reason not to do that, i guess I was lazy?).
Now, as far as a hack goes, I believe one can try and make [savestate] behave like initbang, but I wouldn't know how they would differ and about any caveats (and I fear there might be ones). This is not something officially documented or supported.
Cheers and happy new year to all here in this beloved Pd community
Em qua., 31 de dez. de 2025 às 14:02, Alexandre Torres Porres < porres@gmail.com> escreveu:
I made a new one for [closebang] and will find my time now to add yet another just for initbang (I don't remember having a reason not to do that, i guess I was lazy?).
new year's resolution, try to be less lazy :) see https://github.com/pure-data/pure-data/pull/2812 a new PR to add initbang...