reverse engineering the Nord Lead 4 control board
You can identify and match functions to pins.  Only the OEM designer knows how they are read into memory.  Usually by a chip select to enable bus side read.
From ‘138

8 switches need 3 bits to address.
32 switches need 5 bits to address.
38 switches need 6 bits to address. Or 8 bits as done here.

This can be done with 3 bits to ‘138 and 3 more bits from CPU using matrix array if switches are not grounded.  This uses typical low to select 1 of 8 rows and “1” to bias 5 Columns with diodes or in software input open cct or output=1. Thus 3+5 software switches = 8 bits from CPU during port  8 address bits then read switches like RAM. Or any variation of this.

CPU inputs 3 but address to ‘138 decoder to select 1 of 8 latches in a sequential manner as fast as it needs to.  Classic bus MUX.