Shitwave - A PRNG based drone generator for Gameboy

March 23rd, 2009

Shitwave vis 1 Shitwave vis 2
Little-scale recently posted All 4-bit Waveforms That Have 32 Samples, a Max patch that would generate all possible wave frames that could be used with LSDj, given gazillions years. However, the result was a little boring because it would start out as a 1/32 PWM and slowly progress towards a longer and longer PWM. Even within many years, chances are you’d still have a very low duty PWM.
So I decided to find an algorithm that would produce more interesting sounds and still cycle through all 1632 possibilities. My choice was a Pseudo Random Number Generator using a Linear Feedback Shift Register. Actually not completely unlike the one in the Gameboy’s noise generator.
However, where the GB’s generator goes through a small number of states, and the buffer constitutes one sample, I’m using the full 16 bytes (32 samples) used in the Gameboy’s wave channel as my shift register. (Equivalent of one frame in the LSDj softsynth)
The shift register is a regular Fibonacci where the two topmost bits are xor’d with each other and shifted in at the bottom. The program is written in spaghetti style hardcore assembly language and the code is 256 bytes big. (The file header is another 80 bytes. So all in all, the program is 336 bytes.) The rest of the 32 kB is zeros, so there’s room for additional functionality. (Suggestions, anyone?)
The visuals are showing the currently playing waveform. The background pattern for the visuals are generated with a simple xor algorithm to make it appear random.

Unfortunately I don’t have a camera with a microphone, or even editing software that can handle the non-standard MOV file that my DSC gives me. So the audio is recorded separately from the video.

Audio:

Shitwave  by  nitro2k01(Gameboy Genius)

Video: (No sound :( )

And last but not least… The ROM for those who dare and desire to try the program themselves.
shitwave1.zip (637 bytes, zip)
A and B (Or left and right) controls the type of visualization used. Select (Or up) re-seeds the PRNG. Preferably, run this program on real hardware, not in an emulator. If you must use an emulator, use no$gmb.

Oh, the name “Shitwave”? I mispelled “Shiftwave” when creating the folder for the project, and then I decided it was a fitting name.
Shitwave in no$gmb

Shitwave in a hex editor

18 Responses to “Shitwave - A PRNG based drone generator for Gameboy”

  1. Mr Tomczak says:

    “it’s boring waaah”. Awesome work, Nitro! Very, very impressive.

  2. 10k says:

    can’t wait to give this a go.
    Ima use it in my set as a reference to you both!

  3. Mr Tomczak says:

    do it as i will be there with you in spirit. im sorry i can’t make it. and nitro, i’m going to be using this as part of a performance if that is okay with you.

  4. nitro2k01 says:

    You m may proceed, sir!

  5. dotdummy says:

    Sounds good in emulator thru PC speaks at work… can’t WAIT to hear it DMG-> amp at home!!!!!!

  6. reiyano says:

    fuckin amazing. How do I get as smart as you guys? little scale and nitro awesome work!

  7. infradead says:

    amazing stuff man.. really cool

  8. TRUE CHIP TILL DEATH » Shitwave - A PRNG based drone generator for Gameboy says:

    [...] Gameboy Genius » Blog Archive » Shitwave - A PRNG based drone generator for Gameboy. Share [...]

  9. Bud says:

    You and little scale are sick individuals.

    Love it.

  10. got80 says:

    great work! so, is there a recording with both audio+visuals available yet? i wanted to show it off somewhere…

  11. analog says:

    amazing, i’m tryin’ it and i love the sound!

  12. jumpingfox says:

    http://depositfiles.com/files/jt5gb8qp6

    no$gmb with bios and firmware

  13. Gameboy Genius » Blog Archive » Shitwave+Ableton Live (Brian Green) says:

    [...] Shitwave running in KiGB, fed into Live. At times like these I feel ashamed that I haven’t added support for any kind of MIDI control yet. It would make Shitwave much more useful for actual composition. But at the point it was more of a proof of concept. [...]

  14. New Stairlift says:

    Great work. Sounds good in emulator thru PC speaks at work. Thanks

  15. werto says:

    That’s lovely!
    But unfortunately link to download it is not working…

  16. Shitwave synced to LSDj - Data Airlines says:

    [...] of a LTC1799 variable oscillator which is contralling the clock frequency of the DMG running Shitwave. (Don’t forget that Shitwave sucks [...]

  17. infradead » G1 and shiftwave: a match made in heaven? says:

    [...] First off a confession. Shiftwave as a name was totally lifted from the blog of the creator of shitwave. [...]

  18. DVELOP says:

    this is effin great work! I love it.

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.