Em sex., 20 de jan. de 2023 às 13:56, Miller Puckette msp@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