Find non-zero index

noiseandrones's icon

Hi all,

I have a patch with an mc.cycle object, running a harmonic series.

A multi slider controls the level of each partial.

I would like a readout of every active partial.

To do this, I'm trying to find the index of every non-zero value in a list.

I have 80 sliders, so let's say eight partials are active (non zero) - how do I find the index of each one, in one go? So for instance, let's say partials 10, 11, 40, 41, 50, 61, 62, 71 are active - I want to be able to see this all in one list quickly.

Additionally, I'd like to associate each index with the frequency to which it applies - basically, I want to know which frequencies are active.

I already have a frequency readout and index readout in the patch, but I can't find a handy way of collating this information quickly.

Any ideas?

double_UG's icon

zl.filter 0.

Max Patch
Copy patch and select New From Clipboard in Max.

Max Patch
Copy patch and select New From Clipboard in Max.

noiseandrones's icon

Thank you - works perfectly! :)