Generating a midi signal from switches or digital logic
There must be something off the shelf that can do this.


Not really. Every MIDI controller (that's what the thing you're making is typically called) that's sold has a slightly different set of functions besides the main note-generating keys, so it will want slightly different programming of the relationship between the input controls and the MIDI outputs.

And it's more complex and expensive to build two boards/modules where one does the notes and the other does other functions. (Especially if the other functions modify the MIDI, like arpeggiation.) That doesn't mean that what you want is hard, it just means that it's not automatically an off-the-shelf part found in normal controller hardware.


  What exactly is the board called that goes in that space?


It wouldn't have a name besides “the (main) board” for that product, likely.

What goes on that board is:


a keyboard matrix — an arrangement of wires plus possibly diodes and/or multiplexer chips to reduce the 24 separate switches into something that can be scanned using a reasonable number of IO lines. (This is exactly the same technology that you'd use for a computer keyboard or a 16-key numeric keypad or anything else with lots of buttons. There are lots of ways to do it and information is readily available — look for "key matrix" and "scanning".)
A microcontroller, which has been programmed to scan the keyboard and generate MIDI commands.
Possibly an output buffer for the MIDI signal.
Power supply and other such supporting components.


The thing which is most likely to be off-the-shelf in this bundle is the code to generate the MIDI commands, which might be reused among many products. (I don't know myself if there's recommendable open-source code for the purpose.)

If you're willing to program, a 24-key diode-matrixed keyboard can be scanned with 10 GPIO pins, which is well within the capabilities of an Arduino board or most any other microcontroller dev board. So you'd need some diodes and an Arduino and you're done but for the software.



That said, there are ready-made boards that you could drop in to do this job.

I searched for "midi controller board" and found this company selling boards specifically for custom MIDI controllers. Here's another one, or here. (Not a buying recommendation; just examples.) Of course, you'll pay a fair bit for a specialized, low-volume development board that does more than you need.

You could also find an old junked controller (or piano with MIDI out) and salvage the board from it, wiring up your replacement key switches, as long as it doesn't turn out to need any of the stuff you'd be cutting away (e.g. expecting some front-panel slide switch to be making contact, which you could fix by wiring across the relevant terminals; troubleshooting skills are useful here to figure out how to make it work).