SpecDrum programming information

The place for codemasters or beginners to talk about programming any language for the Spectrum.
pianomatt
Berk
Posts: 15
Joined: Sun May 12, 2019 9:38 pm

SpecDrum programming information

Post by pianomatt » Sun May 12, 2019 9:44 pm

Hi Everyone

I have a Cheetah SpecDrum for my Speccy - basically an 8-bit DAC that works with some software to turn the humble Speccy into a drum machine. I've had a thorough search online and nobody seems to have any information on how these things work or what format the samples are in, so I'm interested to try to find out myself. The ultimate goal is to somehow inject my own samples via the program's ability to load additional kits.

What would be the best way to locate the sample data in memory? The FUSE emulator supports the SpecDrum, so I can emulate it easily.

Any info would be greatly appreciated.
0 x

User avatar
djnzx48
Manic Miner
Posts: 398
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: SpecDrum programming information

Post by djnzx48 » Sun May 12, 2019 10:11 pm

I too would be interested in finding out about this. I'm not familiar with the SpecDrum software, but a first likely step would be to set a breakpoint in the debugger whenever an OUT instruction occurs, and then see if it's loading sample data from somewhere. SpecEmu can do this pretty easily, and Fuse probably can too, but the syntax there is a bit cryptic.
0 x

User avatar
djnzx48
Manic Miner
Posts: 398
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: SpecDrum programming information

Post by djnzx48 » Sun May 12, 2019 10:33 pm

Just found this: the Amdrum. It's apparently a version of the SpecDrum designed for the Amstrad, and they've handily included part of the playback routine. That could help in getting the samples.
0 x

zxbruno
Berk
Posts: 46
Joined: Sun Mar 04, 2018 6:13 am

Re: SpecDrum programming information

Post by zxbruno » Mon May 13, 2019 1:29 am

It may be worth mentioning a very old Speccy.org (translated) topic:

http://tinyurl.com/Specdrum-topic-translated
0 x

Alcoholics Anonymous
Berk
Posts: 30
Joined: Mon Oct 08, 2018 2:36 am

Re: SpecDrum programming information

Post by Alcoholics Anonymous » Mon May 13, 2019 4:02 am

It's just 8-bit unsigned samples to port 0xdf.
0 x

User avatar
djnzx48
Manic Miner
Posts: 398
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: SpecDrum programming information

Post by djnzx48 » Mon May 13, 2019 5:02 am

But the samples themselves are stored as signed. From the playback routine, conversion to unsigned only happens just prior to the output, otherwise the DC offsets would add up and clipping/wraparound would occur.
0 x

pianomatt
Berk
Posts: 15
Joined: Sun May 12, 2019 9:38 pm

Re: SpecDrum programming information

Post by pianomatt » Mon May 13, 2019 9:58 am

I've made some slight progress by using the debugger tool in FUSE. By pure chance I found a line of assembly loading something from 0x8400, so I dumped the memory from that location and loaded it as raw sample data into Audacity. The sample rate seems to be around 16kHz, because at that sample rate the drums sound more or less the same as they do coming out of the SpecDrum.

Image

The sample order is Snare, High Tom, Low Tom, Cowbell (more required), Closed Hat, Open Hat, Clap then Kick.

I'm going to assume that the software has a list somewhere of where each sample starts, because the samples aren't of uniform length.
1 x

pianomatt
Berk
Posts: 15
Joined: Sun May 12, 2019 9:38 pm

Re: SpecDrum programming information

Post by pianomatt » Mon May 13, 2019 10:26 am

I've found another TZX online with a different kit, and loading that in also saves the samples at 0x8400. The sample boundaries also line up, so maybe they're hard coded?

Image

Are there any tools out there designed to dissect TZX files to see what is going on? I might be able to learn more by looking in the Afro tape, and use it as a blueprint for making my own.
0 x

User avatar
djnzx48
Manic Miner
Posts: 398
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: SpecDrum programming information

Post by djnzx48 » Mon May 13, 2019 10:32 am

Not sure if it's what you're looking for, but you could try this.

Edit - never mind, I thought you were using Windows. It probably works in Wine anyway.
0 x

User avatar
djnzx48
Manic Miner
Posts: 398
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: SpecDrum programming information

Post by djnzx48 » Mon May 13, 2019 11:41 am

I tried to have a closer look at the code, but it's just too crazy for me. There's self-modifying code all over the place and it's impossible to tell what's going on. Anyway, I think the main loop starts at $fa00 and it's decrementing some sort of counter, which may be useful to find the sample lengths.
0 x

Post Reply