Introduction
I’ve added some new features to the ApOPL3xy synthesizer project I talked about in my last post. Some technical details follow, but first, let’s check out what the new version can do. Specifically, MIDI files can now be played from a computer (or other sequencer) into the ApOPL3xy to be synthesized.
Demo Songs
Here are some example songs. These songs were recorded by playing MIDI files from a computer into the ApOPL3xy’s MIDI-In port, running its audio output into the computer’s line-in jack, and capturing the line-in signal with Audacity. None of these files were post-processed in any way, other than to crop off leading and trailing silence. Links to the source MIDI file and the recorded MP3 are available for each song.
Harold Faltermeyer – Axel F (Beverly Hills Cop Theme) [MIDI] [MP3]
Alan Menken – Under the Sea (from The Little Mermaid) [MIDI] [MP3]
Europe – The Final Countdown [MIDI] [MP3]
Finally, I would be remiss not to include this masterpiece 🙂 [MIDI] [MP3]
New Features
Non-Volatile PATCH Storage
In my previous post, I discussed the Fat Man’s General MIDI 2-operator and 4-operator OPL3 patch sets. I’ve added the patches from the 2-operator set into the system, so they’re readily available without laboriously entering them using the UI.
They’re stored on an EEPROM chip (Microchip 25AA1024) for non-volatile storage, and cached in an SRAM chip (Microchip 23LCV1024). From there, they can be loaded into the ATmega1284’s system RAM as needed and sent to the OPL3 synth chip for use. I updated the patch editor UI to allow the user to select which patch to edit, and whether to save the edits in SRAM only or also in EEPROM.
OMNI MODE
Previously, the ApOPL3xy only processed MIDI messages on MIDI channel 1. Messages from other channels were ignored. This was enough to get the keyboard controller to be playable, but to play multiple instruments simultaneously, a synthesizer needs to be in omni mode. In this mode, the synthesizer processes messages from all 16 MIDI channels.
I’ve implemented support for omni mode in the latest version. (In fact, omni mode is always on now, as I have not yet added a UI option to turn it off.) A separate patch selection (a.k.a. “program”) can be made for each channel, allowing multiple different but concurrent instruments to be synthesized.
Soon, I plan to add a UI utility to select patches for each channel, but for now, I’ve implemented handling for the Program Change MIDI message to allow an input MIDI device to make the selection.
PERCUSSION CHANNEL
I’ve also implemented a percussive channel mode, which is commonly used for MIDI channel 10. This mode is special because the patch that gets used when a note is played depends not on the channel program setting, but on the note number itself. For instance, note 35 (B0) is for an acoustic bass drum sound, and note 40 (E1) is for an electric snare sound.
The Fat Man’s patch set includes a bank of percussion sounds for this purpose, and I’ve uploaded them to the EEPROM as well. I haven’t yet updated the patch editor to be able to edit these, but I will soon.
Note that this is distinct from OPL3’s percussion mode, which I also plan to support in the future. This mode was not often used, and in fact, none of the patches in the Fat Man’s sets use it. It’s therefore a lower priority. But it’s something the chip can do, so I want the ApOPL3xy to support it.
Update / Bug Fix
I was looking through the code yesterday, and I found a bug with pitch bend that would cause a pitch bend on one channel to bend new notes on all channels. The careful listener might have noticed something off with Africa and The Final Countdown. I’ve since fixed it and uploaded new recordings for the two affected songs, but I’m putting the original broken versions below for posterity.
Toto – Africa (Pitch Bend Bug) [MP3]
Europe – The Final Countdown (Pitch Bend Bug) [MP3]
Leave a Reply