CPCWiki forum

General Category => Programming => Topic started by: redbox on 13:28, 27 May 21

Title: Perfect Digidrums on a classic CPC
Post by: redbox on 13:28, 27 May 21
I've created a routine and a small demo which shows digidrums (and accompanying AY tune) imported from the Atari ST being played perfectly on the classic CPC.  The timing is very tight, but there are still over 10,000 nops free every frame to do something else.

@XeNoMoRPH (https://www.cpcwiki.eu/forum/index.php?action=profile;u=1952) very kindly recorded a video of the demo playing on a classic 464:

https://vimeo.com/555618320#t=2m10s

This demo sounds much cleaner than the version made by Overflow for Backtro:

https://www.youtube.com/watch?v=OkslG1SBRo8&t=11s

I've attached the source code and a DSK image to this post.
Title: Re: Perfect Digidrums on a classic CPC
Post by: GUNHED on 18:27, 27 May 21
Nice, how much "drum-bytes" do you send per second?
Title: Re: Perfect Digidrums on a classic CPC
Post by: redbox on 20:13, 27 May 21
Nice, how much "drum-bytes" do you send per second?

The digidrums on the ST are 6826.67 Hz.  This is calculated by taking the ST time (2457600 Hz) and dividing it by the interrupts being TP (4) and then TC (90).  2457600/4/90 = 6826.67 Hz.

Then I described the CPC timings in the source code:

Code: [Select]
        ; YM digidrums are 4-bit @              6826.67 Hz
        ; CPC frame is                          15625 Hz
        ; CPC is 300 scanlines * 64 nops =      19200 nops
        ; 15265hz / 6827hz = 2.275 * 64 nops =  146 nops
        ; or to make it CPC friendly we use     150 nops
        ; because 19200 nops / 150 =            128 iterations per frame

So, 128 bytes of digidrum are played every frame.  I split the digidrums into 128 byte sections to make it easier to trigger them in the pattern.

To answer your question, 1 second of sound would be 128*50 = 6400 bytes.
Title: Re: Perfect Digidrums on a classic CPC
Post by: GUNHED on 20:16, 27 May 21
Nice! Cool work done!
Title: Re: Perfect Digidrums on a classic CPC
Post by: BSC on 22:44, 27 May 21
The part between 0:33 and 1:30 was ... interesting ;-)

Cool project! Your player code reminds me of my SID stuff some years ago. When has time become so incredibly fast..?
Title: Re: Perfect Digidrums on a classic CPC
Post by: redbox on 23:33, 27 May 21
The part between 0:33 and 1:30 was ... interesting ;-)

@XeNoMoRPH (https://www.cpcwiki.eu/forum/index.php?action=profile;u=1952) can take credit for the video, he very kindly recorded it for me so we could hear it on a real CPC!  I just sent him the DSK file.

Your player code reminds me of my SID stuff some years ago.

I'm soooooo "last gen"...!  8)

Seriously though, I wanted to get digidrums working with plenty of NOPs left to do other things.  Other previous classic CPC digidrum attempts released with source code that I could find (including mine) are pretty rough and I just wanted to share some source code of how it can be done precisely.
Title: Re: Perfect Digidrums on a classic CPC
Post by: m_dr_m on 23:35, 27 May 21
Yep I'm not sure what @Overflow (https://www.cpcwiki.eu/forum/index.php?action=profile;u=695) has done with this one? Noise register still open? Sample replay interrupted for too long?


Check Shap's replay of Madmax digidrums: https://www.youtube.com/watch?v=OSy4BCKrAuw (https://www.youtube.com/watch?v=OSy4BCKrAuw)
Or Targhan's own digidrums: https://www.youtube.com/watch?v=4wGTnz82es0 (https://www.youtube.com/watch?v=4wGTnz82es0)


If anybody remember better ones, let us know!
Title: Re: Perfect Digidrums on a classic CPC
Post by: redbox on 00:19, 28 May 21
Check Shap's replay of Madmax digidrums:

Fantastic, thank you.

I’m not entirely convinced the samples are being played at a precise resolution though... it could just be my ageing ears or something else like 8-bit converted to 4-bit.

I guess without the source code we will never know!
Title: Re: Perfect Digidrums on a classic CPC
Post by: Targhan on 01:53, 28 May 21
You can also check out the Imperial Mahjong digidrums/samples (see my signature to download the game... no video would capture the EGX mode well!).
Title: Re: Perfect Digidrums on a classic CPC
Post by: BSC on 17:40, 28 May 21
You can also check WEEE!s Wow-Part of Terrific Demo:

https://www.youtube.com/watch?v=9JGmLLzD_o8

Some of the best early digi drums. I don't think any french production ever came close to the quality ;)
Title: Re: Perfect Digidrums on a classic CPC
Post by: BSC on 17:46, 28 May 21
Check Shap's replay of Madmax digidrums:

Sound pretty dope to me.

The digi-drums by Overflow do not only sound distorted but also seem to be at least 1 tick/frame too early each time.
Title: Re: Perfect Digidrums on a classic CPC
Post by: m_dr_m on 21:04, 28 May 21
Some of the best early digi drums. I don't think any french production ever came close to the quality
Right! Remember now having been blown away by this tune. Original drum-set, and excellently used!