Of course a real grand needs at least a sustain pedal (for cheating with hard pieces 😉 ). As my original digital piano already had three pedals mounted I decided to simply use them. Incredibly I had to discover that the original pedals contained potentiometers already, although the original electronic was just reading them as on/off switches. As the mainboard controller already had used its 8 ADCs and the UART for the MIDI port I added an additional AVR to the board implementing all three pedals with the full MIDI range. Of course many will now say I should have used a bigger microcontroller that features more ADCs and UARTS, but considering this being a prototype only and two other facts let me think it was the best decision for me:
- I had to use 16 bit integer division for each pedal sample to divide it down to the MIDI range. And I did not want to let this delay the handling of keystroke messages.
- I planed to have an RS232 connection to the PC being able to debug and backup parameters.
Besides I wanted the project to be continued as fast as possible and I only had the AVRs there, with which I have the experience to get a circuit working quickly. So here is the new mainboard: