This is a snippet of our code, more specifically, it is a MIDI handler function that we wrote to handle the “On Note” MIDI event. It takes a channel as a parameter, assigns it to thee appropriate voice, and then checks if the voice is a square channel or drum channel. From here, the code handles the appropriate channel, updates the pitch of the note, and sets the attenuation of the note.
For our project, we decided upon a MIDI controller because it sounded (ha, get it?) cool.
We wanted to be able to build something that would take MIDI files, convert them into 8 bit music, and play them out loud. We took inspiration from the music which we heard in older video game consoles and arcade cabinets. The songs we would choose would be from different games, TV shows, and movies that we all enjoy. On that note (more puns), this allowed for each member of the team to have some input in the direction we took with the project and get something personally enjoyable with the finished product.
Here we have our circuit schematic for our project. Initially designed by Evan McManus and drawn in AutoCAD 2019 by Brian Popham.
And here is a picture of the project:
To give a brief explanation of the project, we are using two SN76489AN PSGs (Programmable Sound Generators) to output 6 square waves channels, and two noise channels, which is driven by an independent Crystal Oscillator. We are using the Arduino based Teensy 3.5 board to receive native USB MIDI events. Our code is set to handle these events when they occur, such as Note On or Note Off, and will then interpret the messages, translate them into data the PSGs can read, and then output them to the PSGs. This is then handled by the PSGs, which then sends audio data to a 3.5 mm jack with bridged audio connections.