John L wrote:Yes indeed, Nick. In fact there is no need in this application for anything like 0-127 granularity. Eight steps from minimum to maximum would probably do it and 16 definitely would.
Arduino's ADC provides an integer value in the range 0..1023. At the moment I am rounding that to 0 to 127 in steps of one but I think 16 steps of 8 would make more sense. That would significantly reduce MIDI traffic as a result of inconsequential changes of expression pedal position.
Edit: As it was only a one line change I tried out 16 steps of 8 and it seems to be just fine. The expression change per step is barely perceptible and MIDI traffic is now negligible.
Edit 2: I also changed the update rate to 100ms and again there is no discernible change in expression pedal behaviour. This means that an expression pedal can only ever create ten MIDI messages per second, which is negligible.
I believe that many pipe organ swell shades have only 8 positions from open to closed but there are some crescendo switches with 40 positions on the switch. Hauptwerk Master Crescendo has a large number of virtual positions but I am not sure if it is greater than 40. It appears that even forty steps would require a 64 step resolution in the A/D for the pedal. Reference Arndt Organ Supply expression pedal with multiple reed switches for an example of this implementation. I have encountered MIDI implementations in Rodgers and Allen consoles that output stepped crescendo using program changes also. Perhaps 127 granularity is too much but if 64 steps are required is it really that much better than the standard 127?
Thomas
Edit1: The MIDI standard for 'granularity' appears to be 0-127. This applies to all A/D functions and note velocity.