it's pretty simple. Just follow the instructions for the MID400 AC line monitoring chip. There is one resistor on the input, this is set according to the voltage you are monitoring - in this case 42volts AC. The AC line monitoring chip has a built in schmitt trigger, so it holds a logic high until the AC signal has stopped for at least 40 ms. I am not sure how long, but in this application it is long enough (each AC cycle is 16 ms) .
The chip runs on 5 volts, the pi gpio pins want 3.3v, so a simple voltage divider suffices to drop the voltage. The chip inverts the signal - so you want to pull the chosen gpio pins high - any resistor 2.5k and up will do, then the chip pulls the pin to ground when it senses an AC signal on the input.
BTW I found the pi to be a little less sensitive to noise when I used a "strong" pullup of 2.5k vs the more std 10K or even 50k resistors. The internal pullup /down resistors are 50k and static will trigger the gpio pins.
I used 2.5k for the rotary encoder pullups and for the push button. I used a debounce capacitor and software debounce on the selector switch..doing this again I would use a better pushbutton.