Gameboy project week 6: Can I have an A-MEN?

February 11th, 2013

Fixed the download link at the bottom of the post.

I’m tired. I need a break. What better choice than the amen? Probably a dozen, but nevermind that.

This week’s ROM is a sample masher that lets you apply live effects and rearrangement to a loop. As such, it’s using the wave channel. During the development of my sample playback routine, I accidentally discovered a solution to an old problem. The wave channel on the Gameboy has a buffer containing 32 samples, or 16 bytes which is normally used to store a repeating wave form such as a sawtooth wave, square wave or sine wave. However, if you continually reload the buffer with new data, you can play a sampled waveform. This is all well except that the channel needs to be stopped before the buffer can be reloaded. The problem is that this causes a small spike in the waveform. It is noticeable on a DMG, but completely abhorrent on a GBA, to the point of making kit instruments unusable. I found a solution to this problem which is simple and elegant, which is to simply turn off the channel in ff25, the sound routing register, while the buffer is being refilled.

With some swift work from Johan, this fix, which I call the antispike fix, is now included in the latest version of LSDj, 4.7.0. And kit instruments now sound eh-ok on GBA.

So, this week’s ROM is a simple, GUI-less ROM which lets you process a short loop, for example an Amen. This is another “failed” project in that it doesn’t have all the functionality I originally wanted to include. Here’s the functionality in this version of the ROM:

  • You can press start to start or stop playback of the loop.
  • The loop can be freely pitched by pressing select+up/down.
  • While the loop is playing, the ROM sends out an LSDj compatible sync signal on the link port.
  • You can press the D pad to rearrange the loop in 16th “slices”.
  • You can apply effects by holding either B or A, or both. B enables a granular/repeater effect. B+up/down controls the repeat size. A enables a stutter effect. A+left/right controls the stutter length.
  • Effect values can not be changed while one direction on the D pad is held down. While this might sound strange, the purpose of this is that you could be able to “roll” around on the D pad to mash the beat while an effect is triggered without changing the effect values.
  • Finally, you can press select+start to enable a “special” effect. When this effect is active, the pitch of the wave channel does not follow the general pitch of the loop. This causes a phasing type effect when adjuting the pitch.

Sound examples, some notes on the development process as well as information about how to replace the sample with your own sounds will follow shortly.

Fixed link: Download

4 Responses to “Gameboy project week 6: Can I have an A-MEN?”

  1. Theta_Frost says:

    Awesome! Really neat to have this antispike fix. GB sound keeps getting cleaner! I really like this ROM too. Being able to replace the sound will be perfect and syncing to LSDJ is so useful. Looking forward to future work on it!

  2. RjGrayBoy says:

    All hail the amen and all hail nitro2k01! I always thought that one day there would be a fix! Today is the day my gb is coming back out and i can finally recap it. Now i want to know why i looked at the lsdj changelog in the first place.

  3. swiddcheese says:

    replacing the wav as the first poster said would be awesome

  4. swiddcheese says:

    “Sound examples, some notes on the development process as well as information about how to replace the sample with your own sounds will follow shortly.”

    Thanks Nitro im eager to hear a few classic D&b breaks off my GB,

    I suspect we gotta use a 4/8bit wav at a specific sample rate, will there be a maximum size? ie if we wanted to use longer loops?


Leave a Reply

If you'd rather contact me directly, please use the following e-mail address: It appears that you have Javascript disabled. Please enable it to see my e-mail address.