[PD] can a [clone] instance determine the total number of clones?

William Huston williamahuston at gmail.com
Thu Mar 4 00:23:34 CET 2021


On Wed, Mar 3, 2021, 3:37 PM Christof Ressi <info at christofressi.com> wrote:

> I find myself passing in the number of total clones as a parameter.
>
> Yes, that's the only way.
>


Thanks Christof.

> I would like to avoid this if possible.
>
> Why? Is it only for cosmetic reasons, or for technical reasons?
>

Yes, mostly aesthetics. It seems redundant. It creates extra work. It would
simply my development workflow.

I'm communicating to my clones via arrays.
Each clone reads values from certain arrays, and writes values to other
arrays.

(In the output case, the clone instance number always corresponds to the
array element number, so I can see what each clone is doing. On the input
case, I'm reading at audio rate

So when I change the number of clones, I must change this in the 2 places
you've mentioned. I also have to resize my arrays, which requires changing
at least 1 message. (I imagine that I can probably change all my arrays
using a single compound message, but haven't tried this yet).

Ideally, it would be nice to change N in *one place*. I think this might be
possible if the first feature was implemented.

e.g., "If I am instance #1, and the number of instances has changed since
last time (stored in a global variable), then resize my arrays".

Yes, [clone foo 20 20] might look ugly, but it does the job. Personally, I
> haven't ever needed the number of cloned instances inside an instance...
>
I am still working on converting my 12 band flanger/auto panner to an
N-band Flanger using clone.

If we think about the clones spreading out and creating an equal phase
displacement across all N bands, and if we let S be the instance number,
then we can calculate the phase displacement for an arbitrary instance like
this:

PhaseDisplacement(S) = (2π / N) * S
So each clone needs to know the value of both S ($1) and N.

but if you need it frequently, you can make a feature request on GitHub.
>
I think I will, thanks!

BH


Christof
> On 03.03.2021 20:12, William Huston wrote:
>
> Is there a way for a clone instance to determine the total number of
> clones?
>
> Because often the behavior of a clone depends on its relative position
> within a chain of instances.
>
> "I am instance 12 of 100, therefore, I should behave like so...."
>
> I find myself passing in the number of total clones as a parameter.
> I would like to avoid this if possible.
>
> Thanks,
> BH
>
>
>
>
>
>
>
>
>
>
> --
> William Huston:  WilliamAHuston at gmail.com
> Binghamton NY
>
> *Public Service Mapping / Videography / Research / Education / Safety
> Advocacy*
> Blog <http://WilliamAHuston.blogspot.com> -- Facebook
> <http://facebook.com/billhuston> -- Twitter
> <http://twitter.com/WilliamAHuston>-- Youtube
> <https://www.youtube.com/channel/UCGijK1amWOLglT3YeTyEBNQ?sub_congfirmation=1>
> * -- Podcast Blog <https://billhustonpodcast.blogspot.com/> *
> *Document collections*: VirtualPipelines
> <http://TinyURL.com/VirtualPipelines> -- BHDCSDimockArchive
> <http://bit.ly/BHDCSDimockArchive>
> *Please support my work! -- *TinyURL.com/DonateToBillHuston
>
>
>
>
> _______________________________________________Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
>
> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management ->
> https://lists.puredata.info/listinfo/pd-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20210303/687130a3/attachment.htm>


More information about the Pd-list mailing list