Help with wiring in encoders

I sometimes found pages like this quite helpful. You’ll see that in your case on physical pin 36 the number 27 doesn’t refer to the GPIO number (16) but to the WiringPi number (27).

I have to second @wyleu about the MCP23017 solution makes it a lot easier because you don’t have to think so much about free GPIO pins other HATs and stuff might want to use. I use pin 36 and 37 alone for it (plus SDA and SCL of course).

Otherwise you may have to take care about GPIO your soundcard HAT, MIDI I/O, EEPROM and so on blocks.

I went through the whole process with the help of these wonderful folks here.