August 15, 2020, 04:03:11 am

The shoutbox is currently out of service. Join us on Discord instead.
You can help CodeWalrus stay online by donating here.

WARNING: DO NOT UPGRADE your TI-83 Premium CE or TI-84 Plus CE to OS 5.5.1 and higher. It removes all compatibility with most games and removes ASM/C programming! DOWNGRADING IS IMPOSSIBLE. BE WARNED! Likewise, do NOT update your TI-Nspire CX past OS 4.5.0, else using Ndless and ASM/C programs will be impossible.

rawp music routine for TI-82/83/83+/84+

Started by utz, July 29, 2015, 12:34:32 pm

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


July 29, 2015, 12:34:32 pm Last Edit: July 29, 2015, 12:37:53 pm by utz
As a byproduct of stuff I'm currently working on, I ported my rawp sound engine from ZX Spectrum to TI Z80. Thanks to the faster CPU, it sounds much, much better than the original Speccy version. Unfortunately the routine is fairly large and does not use interrupts, so it is not too terribly useful for games. Maybe you'll find it useful for the 1-bit forum competition though ;)

Anyway, for those of you who aren't aware of the original engine, here's the feature list:

- 2 tone channels
- 13 different waveforms
- limited volume control
- 1 interrupting hihat sound
- per-step tempo control

For your convenience, the routine comes with an XM converter. So you can compose your music in something like Milkytracker and then compile it using the provided scripts (Win/*nix). Note that this requires Perl to be installed on your computer.

sound example


Cool. Is the source included? I'd love to get an inner knowlege of sound engines
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


July 29, 2015, 11:30:03 pm #2 Last Edit: July 29, 2015, 11:33:53 pm by utz
Yes, source is included. It's even annotated to some extend, but overall this one is rather tricky to understand. Basically what happens here is this: There are some specially crafted samples to create the waveforms. Each sample is 256 bytes, with each byte representing an output state (on or off). Groups of 4 bytes are combined and interpreted as a volume level by the player. Consequently, there are 5 OUT commands per channel (4 levels + silence). So you can think of the samples as a sort of PCM format, but instead of packing 2⁸ volume levels in one byte or 2¹⁶ in a word, you pack 5 volume levels in 4 bytes. This is done so the player can read the sample data as fast as possible.

Mind you, the engine was optimized for a 3,5 MHz machine and is now running in 6 MHz, so there is room for improvements. Especially if you'd think about targetting 15 MHz.

DJ Omnimaga

I replied to this but here's a repost since my post was lost: I loved how this sounded like. It seemed like MIDI but in lower sample rate. It would definitively be interesting to hear music made with this :)

Powered by EzPortal