TreeFallSound / pi-stomp

pi-stomp is a DIY high definition, multi-effects stompbox platform for guitar, bass and keyboards
https://treefallsound.com
GNU General Public License v3.0
104 stars 19 forks source link

v3 hardware support, switches refactor, tap tempo on switches #72

Closed rreichenbach closed 1 year ago

rreichenbach commented 1 year ago

Lot of stuff here. Mostly to prepare for v3 hardware support and to avoid more class and code bloat.

v3 foot switches are connected to ADC inputs instead of GPIO as they were for v1 and v2. Very cumbersome having different code just because of how a switch is triggered. This attempts to make that somewhat better. a gpio_input or adc_input argument given to the Footswitch constructor (likely from the config file), determines which type of class to use for detecting switch events (GpioSwitch or AnalogSwitch).

EncoderSwitch no longer needed.

SwitchState added so all code can reference a common enum for switch state.

TapTempo added to provide tap tempo calculation to either type of switch. No code consumes that yet, but could easily do so via Footswitch.get_tap_tempo()

EncoderMidiControl added for tweak knob style controllers via encoder hardware (a concept new for v3)