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 BGB

Shitwave in a hex editor

28 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.

  19. Twitter Trackbacks for Gameboy Genius » Blog Archive » Shitwave - A PRNG based drone generator for Gameboy [gg8.se] on Topsy.com says:

    [...] Gameboy Genius » Blog Archive » Shitwave - A PRNG based drone generator for Gameboy blog.gg8.se/wordpress/2009/03/23/shitwave-a-prng-based-drone-generator-for-gameboy/ – view page – cached * Bill Hicks on Rick Astley, creationists and positive drug stories * Regarding the message on the 8bitcollective front page… * 3 new tracks (+1 old one) * Twuttr * Shitwave synced to LSDj * Figma - Drossel von Flügel * Best g’damn action scene ever! * LittleFM on GBC * ReBub * Red onion macro and photo dump! * 漢字 test Tweets about this link [...]

  20. EM__Dash says:

    Amazing work. Just wanted to say that I’ve been using this for generating visuals. Through No$GB on a PC or using an EMS cart in a Super Game Boy and SNES, you can change the four shades of gray to whatever colors you wish and project this as a background of pixelated static that can be controlled, to some extent, by pressing A, B, and Select, more so if used with an emulator with an adjustable frame rate or a LTC1799-pitch bent SuperGB.

  21. nitro2k01 says:

    Oh cool. Knowing that someone is actually using it after so long almost makes me want to take up development again.

  22. EM__Dash says:

    It’s a fantastic piece of code. If you’re willing to share the source, I’d love to work on it some more and add controls (such as pause, reverse sequence, etc.).

  23. nitro2k01 says:

    Let me put it this way, the disassembled code looks cleaner the original source code. And the code is written to be esoteric and weird.

  24. Gameboy Genius » Blog Archive » Untitled installation featuring Shitwave says:

    [...] An untitled collaboration between Simon Mattisson and Marcus Olsson. A Gameboy in a dark room is overclocked until it crashes. I’m almost getting Saw vibes from this. The Gameboy is modded by NeX and is actually being overclocked. The sound is produced by Shitwave. [...]

  25. Travis Hallenbeck says:

    excellent!

  26. Jonny says:

    going to be using shitwave for a noise/drone performance soon. I’ve been wanting an excuse to use it like that since it was released. cheers nitro2k01!

  27. Timmy's sick. says:

    I invented a theramin controller for shitwave.

  28. Timmy's sick. says:

    ok, just kidding. but think of how cool that would be.

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.