Login
A.M.C Gotham
Title:A.M.C Gotham
Category:Demo/Digi
Release Date:
Language:English
Size:64K
Machine:PAL & NTSC
Code Type:Machine code
Distribution:Freeware
 Play Online!
Released by:Legion Of Doom (LOD)
Code by:Csabo
Notes:Plays part of "Gotham" by A.M.C. Playback speed is 6.9 Khz ($80) and the music data contains 16 distinct values (4 bits resolution). Loops after 1:49.
User Rating: 9.3/10 (4 votes)
A.M.C Gotham Screenshot


Author's Comments
I was asked a few times to explain how to do "good" digis, so here are some thoughts on this demo, hopefully it will be useful and/or interesting.

When playing back digi on the Plus/4, there are 3 things to consider:

- The playback speed (or sample rate, the higher the better)
- The bit resolution, or number of distinct volume levels (the higher the better)
- The available memory (the more the better, obviously).

We can choose lower sample rates, which will result longer digis, but in worse quality. At lower rates, the high end is lost, resulting in a muffled sound. $80 for playback speed (this is the $FF00 value for timer interrupt) is pretty decent.

Going with 4 bits is a no-brainer, this allows us to store two values on one byte. Trying to store 3 values on one byte (e.g. 3+3+2 bits) leads to a very noticeable drop in quality, as does using only 2 bits. Going up is possible, but the length of the audio will be halved, which is a pretty steep price to pay.

The maximum audio length we can sample is number of bytes available in memory, times 2, divided by the sample rate. E.g. using the "full" memory ($1000 - $FD00), or $ED00 bytes, at $80 (6927 Hz), means 17.5 seconds of audio. We could just sample that much, loop it, and call it a day.

But that wouldn't be interesting, so finally, here's why choosing what to sample carefully is very important. Why Gotham by A.M.C? It's a massive banger, but it also lends itself well to chopping. In addition, the song is bass-heavy, so the loss of high-end is not as noticeable. Most of the time spent on this demo was done in Audacity (free to download!). Please see the image below:


[ Click for full size image ]


First, I found the 4-bar drop, and chopped it up to 32 beats. This is already 11 seconds! However, you can see that many beats are virtually identical. The kick + screech on the first beat appears 4 times (marked in purple), and the wobble + snare appears many times (marked in teal). With these repeating parts removed, we can reconstruct the entire drop from only 5 seconds of audio (32 beats from only 15 beats). Huge savings!

The original sample is also mixed from Stereo to Mono, down-sampled to 6927 Hz, and exported as an 8 bit WAV file. I called this the first "loop", then repeated this process 5 more times. It's a lot of work! Here's what each loop represents:

- loop 1 (5.172): drop (4 full bars)
- loop 2 (7.241): post-drop (8 full bars)
- loop 3 (2.069): intro
- loop 4 (1.034): wobble-only (no drum) part of the repeated drop
- loop 5 (2.069): fill with speech sample
- loop 6 (0.690): wobble-triplet (from near end of the song)

Total sampled audio length: 18.275 seconds.

I converted these with my WAV converter to ASM files, and the I manually reconstructed each part from the chopped up pieces. I think using the wobble-triplet (which is only two beats) was a great idea, it breathes new life into the entire drop. The one thing I'm not super happy with is the intro, it's spread a little thin, but that's all the memory we had.

Speaking of memory, the 18.2 seconds of audio does NOT fit into the "full" memory from $1000-$FD00. I moved the beginning of the samples to $0600 to make it fit, and even so, it was over by $3D bytes. I chopped off the last $3D bytes of the speech sample and repeated it, it is not noticeable. The digi tables (which are just pointers and lengths in memory) are from $200-$2FF (copied there BEFORE Exomizer can run), and $0400-$05FF. The digi player itself is copied to the zeropage, again, before Exomizer can run. This means the memory is pretty full :-) (Another note: I added a title picture before the demo, but forgot that the memory from $FD00 cannot be used for graphics. I could not cut off the last two lines of the picture - sometimes this is done, to show graphics located from $E000 - so I wrote a small IRQ which toggles the graphics, the lasts two lines are on the page BEFORE. It barely fit!)

That's it, enjoy!

Copyright © Plus/4 World Team, 2001-2024