This week I focused on primarily two things (apart from the design presentation, of course). The first was designing a system for receiving data from the MIDI shield, while the other was beginning to investigate how we’d get audio to output through the use of the DE10-Standard’s builtin 24bit CODEC.
Regarding the first, I was investigating how the SparkFun MIDI shield outputted data being processed from the MIDI DIN cable.
The board features the opportunity to select between hardware and software UART. For the purposes of the actual FPGA, we’re interested in selecting hardware UART (which is enabled by default). Software UART, however, is going to be useful when debugging how the FPGA is processing inputs, since further research revealed that connecting it to an Arduino would allow us to use the library developed by SparkFun to see how input should be properly interpreted (using Serial.print()).
With this in mind, I knew that the hardware UART configuration would output data utilizing the standard MIDI message format as outlined here: https://www.songstuff.com/recording/article/midi-message-format/. This led to me writing up an FSM for parsing MIDI data as outlined here:

This is primarily designed for status messages sent out by the controller that contain two bytes, which are:
0x80: Note ON
0x90: Note OFF
0xA0: Poly Pressure
0xB0: Control Change
0xE0: Pitch Blend
The FSM will be waiting until one of these status bits is sent, storing it in a register and then transitioning to waiting on the two information bytes. If, at any point, a valid status byte is sent out, we transition back into waiting on the 1st byte. Once two data bytes are sent out, we transition into the TRANS_MESSAGE state (where the actual command will get transmitted onto the FPGA). This leads us going back into the GET_1ST_BYTE state, repeating the process all over again. This is a high level representation of what I’ll be trying to implement soon, so the design can (and will probably) be tweaked as needed.
After this, I began researching how the DE10-Standard’s audio codec worked. It supports 24-bit audio, utilizing a 2s complement format. Interfacing with it would require dealing with its I2S interface, utilizing a parallel-to-serial shift register (shifting out bit values one at a time). As I was going over the design for this and the MIDI interface, I realized that the most important baseline for setting up the project is the audio. My partners need a way to test out that their initial implementations are working properly, which means that I should focus on this first. While I’m still on schedule, I hope to complete a functional audio interface with the FPGA next week and then work on the MIDI interfacing afterward (essentially swapping the schedule for both tasks). Overall, though, I have a solid idea on how to move forward with implementing the designs for both.
