[PD-dev] New object to detect # of channels? (was: Removing [output~]?)

Alexandre Torres Porres porres at gmail.com
Fri Jan 20 20:47:53 CET 2023


ok, here's a (maybe stupid) idea, currently, this object I designed gives
you a channel number of "1" if nothing is connected to an inlet~, not sure
if possible but maybe "sp[0]->s_nchans" could give us "0" if nothing is
connected to an inlet~, so this object could be used to also detect inlet~
connection...

Em sex., 20 de jan. de 2023 às 15:51, Alexandre Torres Porres <
porres at gmail.com> escreveu:

> Em sex., 20 de jan. de 2023 às 13:56, Miller Puckette <msp at ucsd.edu>
>> escreveu:
>>
> By the way, I'm coming around to your idea just to 'detect' when a second
>> audio inlet is disconnected and switch the object into mono mode in that
>> case - that's pretty smart :)
>>
>
> Thanks, I don't remember now if it was all me :)  it was discussed if we
> could have yet another output in [inlet~] to show number of connections,
> but it ended up being something too specific. This is the only use case for
> me.
>
> Now...... I already have created my first multi-channel aware external,
> one that detects the number of channels in a multi-channel signal
> connection. I found it useful for my [else/out~] abstraction, which now can
> detect if on the left inlet we have a multi-channel signal. If there's one,
> then I distribute the channels to both outputs :) if we're doing a check to
> see if there's a mono input, we could also do this now in the new [output~]
> object since the next version will support all this ;)
>
> So maybe I can propose we add such an object into Vanilla. This same
> object could maybe also show if a signal is connected, so we can plug the
> outlet of [inlet~] into this new object and we wouldn't need the 'clever
> hack' and also get number of channels. This object could be called
> [sigstatus~] or something.
>
> My object only detects number of channels and it is called [nhcs~]. Here
> it is in action inside my [out~] abstraction. I don't have other examples
> but I think this could be useful for other stuff, maybe other can think of
> more use cases.
>
>
> [image: Screen Shot 2023-01-20 at 15.45.06.png]
>
>
> And here's the code:
> https://github.com/porres/pd-else/blob/master/Classes/Source/nchs~.c
>
> cheers
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20230120/bcd6a7f7/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2023-01-20 at 15.45.06.png
Type: image/png
Size: 32521 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20230120/bcd6a7f7/attachment-0001.png>


More information about the Pd-dev mailing list