mc_channelcount not working correctly in mc.gen~ in a poly~ container

Pselodux's icon

Hey folks, I've encountered an issue with mc.gen~ when used in poly~ in M4L devices.

If I have a 16 channel mc.gen~ patch inside a poly~ container, mc_channelcount will return 0 on load, even though the patch has been instantiated correctly with 16 channels. For the device I'm developing, I use mc_channelcount (along with mc_channel) to calculate harmonic spread for resonators in a modal synth engine. mc_channel returns the correct channel number, and the patch still makes sound, which shows that the patch is loading correctly, it just doesn't sound right of course.

Strangely, adding a dummy gen~ patch to the device's main patcher fixes this issue, and it shows 16 channels on load. So this is my workaround for the time being, but it feels like a bug to me, particularly since the same patch works correctly in Max standalone.

See attached device (and poly~ abstraction) for an example.

test.amxd
amxd 4.48 KB
test.maxpat
Max Patch