Author Topic: Perfect Digidrums on a classic CPC  (Read 631 times)

0 Members and 1 Guest are viewing this topic.

Offline redbox

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.788
  • Country: gb
    • redbox
  • Liked: 406
  • Likes Given: 287
Perfect Digidrums on a classic CPC
« 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 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.

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 2.693
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 1266
  • Likes Given: 2961
Re: Perfect Digidrums on a classic CPC
« Reply #1 on: 18:27, 27 May 21 »
Nice, how much "drum-bytes" do you send per second?
http://futureos.de --> Get the revolutionary FutureOS (Update: 2021.01.24)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.07.15)

Offline redbox

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.788
  • Country: gb
    • redbox
  • Liked: 406
  • Likes Given: 287
Re: Perfect Digidrums on a classic CPC
« Reply #2 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.

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 2.693
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 1266
  • Likes Given: 2961
Re: Perfect Digidrums on a classic CPC
« Reply #3 on: 20:16, 27 May 21 »
Nice! Cool work done!
http://futureos.de --> Get the revolutionary FutureOS (Update: 2021.01.24)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.07.15)

Offline BSC

  • 464 Plus
  • *****
  • Posts: 328
  • Country: de
  • CPC 464 aspirant
    • my (Android) mobile game
  • Liked: 472
  • Likes Given: 427
Re: Perfect Digidrums on a classic CPC
« Reply #4 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..?

Offline redbox

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.788
  • Country: gb
    • redbox
  • Liked: 406
  • Likes Given: 287
Re: Perfect Digidrums on a classic CPC
« Reply #5 on: 23:33, 27 May 21 »
The part between 0:33 and 1:30 was ... interesting ;-)

@XeNoMoRPH 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.
« Last Edit: 10:51, 28 May 21 by redbox »

Offline m_dr_m

  • CPC6128
  • ****
  • Posts: 261
  • Country: se
  • http://orgams.wikidot.com/
    • OrgaMS!
  • Liked: 172
  • Likes Given: 187
Re: Perfect Digidrums on a classic CPC
« Reply #6 on: 23:35, 27 May 21 »
Yep I'm not sure what @Overflow 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
Or Targhan's own digidrums:
https://www.youtube.com/watch?v=4wGTnz82es0


If anybody remember better ones, let us know!

Offline redbox

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.788
  • Country: gb
    • redbox
  • Liked: 406
  • Likes Given: 287
Re: Perfect Digidrums on a classic CPC
« Reply #7 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!

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.382
  • Country: fr
  • Liked: 1310
  • Likes Given: 191
Re: Perfect Digidrums on a classic CPC
« Reply #8 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!).
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

Offline BSC

  • 464 Plus
  • *****
  • Posts: 328
  • Country: de
  • CPC 464 aspirant
    • my (Android) mobile game
  • Liked: 472
  • Likes Given: 427
Re: Perfect Digidrums on a classic CPC
« Reply #9 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 ;)

Offline BSC

  • 464 Plus
  • *****
  • Posts: 328
  • Country: de
  • CPC 464 aspirant
    • my (Android) mobile game
  • Liked: 472
  • Likes Given: 427
Re: Perfect Digidrums on a classic CPC
« Reply #10 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.

Offline m_dr_m

  • CPC6128
  • ****
  • Posts: 261
  • Country: se
  • http://orgams.wikidot.com/
    • OrgaMS!
  • Liked: 172
  • Likes Given: 187
Re: Perfect Digidrums on a classic CPC
« Reply #11 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!