All analogue to digital converters are only stable to the least significant bit. That is the nature of the process. He slightest noise can affect this dithering.
One way to minimise this is to put a 0.1uF capacitor from the wiper of each pot to ground. Also put something like a 47uF capacitor across the 5V and ground at the end of the run powering the pots.
A software method that I use all the time is to only change a reading when the change between the current reading and the last reading is greater than some threshold. You can do this with this sort of statement.
if( abs(lastReading - currentReading > threshold)) { // then send out the reading
Do this before reducing the scale of the readings to MIDI levels, by shifting to the right three places.
From the size of the thing I'd recommend using capacitors - with 32 channels there is little scope for
quality noise filtering in software with a single multiplexed ADC. You need one capacitor for each pot
as it enters the first multiplexer. Not after the first multiplex stage though, that would give crosstalk
between channels.
Thanks for the tip, but with the tip of grumpy mike it works very good, stabble and no jittering of the values. I love the 32 knobs....for the AU/VST synths in logic.