Author Topic: How to create digidrums?  (Read 10072 times)

0 Members and 1 Guest are viewing this topic.

Offline mr_lou

  • 6128 Plus
  • ******
  • Posts: 3.063
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1225
  • Likes Given: 2465
How to create digidrums?
« on: 14:12, 25 May 10 »
Digidrums can be used with STarKos and Arkos Tracker.

But how do I create these Digidrums? I can't find anything when googling.

I thought there might be a tool that would let me convert a mono 8-bit sample on my PC so a digidrum. No?
Then how do I create these digidrums?

Offline robcfg

  • Supporter
  • 6128 Plus
  • *
  • Posts: 2.313
  • Country: se
  • 8-Bit Technomancer
    • index.php?action=treasury
  • Liked: 1031
  • Likes Given: 2457
Re: How to create digidrums?
« Reply #1 on: 14:24, 25 May 10 »
I'd like to know how to manage the .YM files with digidrums.


I know that the digidrum samples are stored within the file an that two phantom registers are used to play them, but I haven't found any info on how to do it.

Offline mr_lou

  • 6128 Plus
  • ******
  • Posts: 3.063
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1225
  • Likes Given: 2465
Re: How to create digidrums?
« Reply #2 on: 14:41, 25 May 10 »
Hm, I just stumbled across this:
http://www.youtube.com/watch?v=0z-jGDOzwGQ

Maybe that's what we need to make those Digidrums?

I'll have a closer look.

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.335
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2264
  • Likes Given: 3478
Re: How to create digidrums?
« Reply #3 on: 14:46, 25 May 10 »
I'd like to know how to manage the .YM files with digidrums.


I know that the digidrum samples are stored within the file an that two phantom registers are used to play them, but I haven't found any info on how to do it.
It seems that this information is not written out by Arkos Tracker, and the program to generate compressed ay for madram's player is not reading it at this time.

If you are using ayc/ym player and digidrums you need to merge the sources of the ay player with the starkos digidrum player together. T o have a player that can do both.

Then in your code have a list of:

<count>
<digidrum>

this will tell you the number of vsync to wait until you play the digidrum.

So it seems this is the only way if you are using madram's ayc player.

EDIT: I posted a message about it on www.cpcscene.com forum.
« Last Edit: 14:48, 25 May 10 by arnoldemu »
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.335
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2264
  • Likes Given: 3478
Re: How to create digidrums?
« Reply #4 on: 14:48, 25 May 10 »
Hm, I just stumbled across this:
http://www.youtube.com/watch?v=0z-jGDOzwGQ

Maybe that's what we need to make those Digidrums?

I'll have a closer look.
What are you looking for?

A tool that will convert samples on the pc into cpc compatible samples for arkos tracker?

I am already planning another example program that will play samples on the cpc (using ay chip), and maybe also one that will play using digiblaster now there is more interest. So I already have the need for a pc tool to create samples in a form the cpc can use.... so maybe I should write one?
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline mr_lou

  • 6128 Plus
  • ******
  • Posts: 3.063
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1225
  • Likes Given: 2465
Re: How to create digidrums?
« Reply #5 on: 14:54, 25 May 10 »
What are you looking for?

I don't know exactly. I just found out that STarKos player routine can play "digidrums". These digidrums exists as *.spl files. So I'm curious about how to create these spl files. Maybe they can be created by some converter tool?

It just seems that, people speak about "digidrums" as if it's a well known concept for everyone. But googling digidrums or spl or similar, gives me nothing.

What is spl files? And how do I create them?

On the STarKos DSK, there's a DIGIDRUM.DAM source file, describing how digidrums are handled. Maybe that helps a hardcore coder (which I'm not).

Offline mr_lou

  • 6128 Plus
  • ******
  • Posts: 3.063
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1225
  • Likes Given: 2465
Re: How to create digidrums?
« Reply #6 on: 15:10, 25 May 10 »
Digiblaster is one thing, and would be great to have.

But the Digidrums in the DIGIDRUM example on the STarKos DSK, plays remarkably noiseless using standard AY-output. That makes me curious. Try the STarKos DSK and RUN"DIGIDRUM

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.335
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2264
  • Likes Given: 3478
Re: How to create digidrums?
« Reply #7 on: 15:58, 25 May 10 »
Digiblaster is one thing, and would be great to have.

But the Digidrums in the DIGIDRUM example on the STarKos DSK, plays remarkably noiseless using standard AY-output. That makes me curious. Try the STarKos DSK and RUN"DIGIDRUM

Technical:

In Starkos, the digidrums use 8-bit samples. The digidrum source mentions 8Khz or 6Khz but I guess any sample rate is possible. In either case, you have to modify the code to define the sample rate of choice. The 8-bit samples are converted at runtime into 4-bit volume values sent to the AY register. In addition in the digidrum sample code it has a hardcoded array which points to the start of each samples data and the size.

The digidrum data is raw 8-bit samples with no header. I can't see if the 8-bit samples are signed or unsigned. It appears they are probably unsigned. But the only way to know is to play them and try them out.

Digiblaster:

Digiblaster uses 8-bit samples also, but I think they are signed 8-bit. The digiblaster code also has a fixed playback frequency, and you must modify the code to set the rate.

robocop style samples:

Robocop uses converted 4-bit samples. Where two samples are packed into 1 byte. Here also the sample playback rate is fixed and defined in code.

So  you'd need special code to make them.


EDIT: Since the digidrums source code comes with starkos, it would be possible to modify it to output samples to the digiblaster.
So with this method you would have 4 channels of sound, 3 AY channels, and 1 digiblaster channel.

EDIT2: To create them the steps would be:
1. record sound or use existing wav on pc.
2. use audacity or goldwave to change sample to 8-bit mono unsigned at 6Khz (default for digidrums code it seems).
3. now you need that converter to read the wav and strip headers etc. (I may be able to cut down the code for samp2cdt or arnold sample reading to do this).

« Last Edit: 16:03, 25 May 10 by arnoldemu »
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline mr_lou

  • 6128 Plus
  • ******
  • Posts: 3.063
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1225
  • Likes Given: 2465
Re: How to create digidrums?
« Reply #8 on: 17:45, 25 May 10 »
3. now you need that converter to read the wav and strip headers etc. (I may be able to cut down the code for samp2cdt or arnold sample reading to do this).

The Digitracker DSK contains a converter for both MODs and Samples. It can convert WAV into SMP files.
Do you think these SMP files can be used directly as digidrums? In other words, are these SMP files the same format as the two SPL files found on the STarKos DSK?

Offline mr_lou

  • 6128 Plus
  • ******
  • Posts: 3.063
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1225
  • Likes Given: 2465
Re: How to create digidrums?
« Reply #9 on: 20:58, 25 May 10 »
They are 8 bits unsigned wav files. I guess they are converted on the fly by my digidrum code.
 
  I've tried loading an SPL file into Milkytracker now, and it appears to  be a signed wav file with reversed signing and some other header stuff  in the beginning. Milkytracker loads it fine. Then I can change signs  to make it a play correct, but the first 130-140 bytes seems to be  header stuff.
 
  Then I tried the same with an SMP file from Digitracker. It appears to  be an unsigned wav, also with some header stuff of 130-140 bytes in the  beginning. (No swapped signs).

So it seems I can complete half the job using Milkytracker, by swapping signs before saving the file. But that doesn't seem to be enough.
 

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.119
  • Country: fr
  • Liked: 1051
  • Likes Given: 152
Re: How to create digidrums?
« Reply #10 on: 21:41, 25 May 10 »
Any good software on PC can convert any sample to 8 bits unsigned sample (Soundforge being the one I use). Be sure to save as "Raw" so that no header comes in your way.
Now keeping all the samples in 8 bits or converting these to 4 bits is a choice of yours, depending of what you're doing. For digidrums, it's fine. Remember that only 4 bits are used in the end by the PSG volumes registers !
If I remember correctly, digitrakker samples are kept as 7 bits in memory, so that (7+7+7)/2=8 bits, that are then converted through a logarithmic table to get a 4 bits sample.
Targhan/Arkos

Arkos Tracker 2 - alpha 9 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 mr_lou

  • 6128 Plus
  • ******
  • Posts: 3.063
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1225
  • Likes Given: 2465
Re: How to create digidrums?
« Reply #11 on: 21:58, 25 May 10 »
Any good software on PC can convert any sample to 8 bits unsigned sample (Soundforge being the one I use). Be sure to save as "Raw" so that no header comes in your way

That's just the thing I'm writing. The SPL file appears to infact contain a header.

If an SPL file is merely an 8bit unsigned wav file saved raw, then I should be able to load an SPL file as an 8bit unsigned raw file using e.g. Audacity, right?

But if I do that, there's clearly some header stuff in the beginning of the file that's not audio. Whatever this header stuff is, it will be missing from the files I save on the PC.

I can also load it as an 8bit signed raw data, which results in signing being swapped - and there's still this header stuff in the beginning.

See the attached image. It's clear that the audio-data doesn't begin right away.

Conclusion: SPL files must contain some kind of header.

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.119
  • Country: fr
  • Liked: 1051
  • Likes Given: 152
Re: How to create digidrums?
« Reply #12 on: 23:06, 25 May 10 »
I guess I did these SPL files. I don't remember how they were done, but if they seem to have a header, that's because I was too bored/lazy to take care to remove it ! Anyway, who cares about a few bytes when you are sending 8000 bytes per seconds ?? Especially if using digidrums :) ! (I didn't look at the source I provided, but you can skip the headers easily in the EQU consts at the beginning).


If you load a headerless format into a good sound editor on PC, it will ask you how to treat it : samplerate (44khz...), bitrate (16/8 bits), Mono/Stereo, and so on. So you can convert your audio stream to WAV or anything else. I really don't know what you're trying to do with these so called "SPL" files, that's just an extension I provided so that people know they are samples. Don't care about that. On CPC, your code is linked to the samples. If I want a 8000hz sample, I won't have a flag telling me so. I'll CODE something that will have to be fed with such samples.


Trg.Aks
Targhan/Arkos

Arkos Tracker 2 - alpha 9 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 Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.119
  • Country: fr
  • Liked: 1051
  • Likes Given: 152
Re: How to create digidrums?
« Reply #13 on: 23:12, 25 May 10 »
I also add that the so called "header" is no interpreted at all : its values are played through the AY like anything else (very dirty !). SPL is really not a format at all. The STarKos digidrums code provided just need sound streams. Now if you want to make your own format and stuff (for whatever reason), you *can*. That's why I made a player that doesn't handle digidrums on its own : it just signals the coder that *something* has happened, whether it be "event signals" or "digidrum". Then, the coder does what he want with it.
Targhan/Arkos

Arkos Tracker 2 - alpha 9 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 mr_lou

  • 6128 Plus
  • ******
  • Posts: 3.063
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1225
  • Likes Given: 2465
Re: How to create digidrums?
« Reply #14 on: 23:27, 25 May 10 »
Alright then. :-)

So the answer to the question "How to create digidrums" is:

You save the audio data as 8bit mono unsigned raw files, and load those in your player routine.

I will experiment now.

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.119
  • Country: fr
  • Liked: 1051
  • Likes Given: 152
Re: How to create digidrums?
« Reply #15 on: 08:50, 26 May 10 »
>load those in your player routine
Or in yours :).
Trg.Aks
Targhan/Arkos

Arkos Tracker 2 - alpha 9 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 mr_lou

  • 6128 Plus
  • ******
  • Posts: 3.063
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1225
  • Likes Given: 2465
Re: How to create digidrums?
« Reply #16 on: 09:01, 26 May 10 »
Or in yours :) .

Nah, I think raw is the best and smallest way of doing it.
Also, I'm no CPC coder, so I need to use existing routines. And why not use the routines from the master himself?  :D

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.335
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2264
  • Likes Given: 3478
Re: How to create digidrums?
« Reply #17 on: 11:25, 26 May 10 »
Alright then. :-)

So the answer to the question "How to create digidrums" is:

You save the audio data as 8bit mono unsigned raw files, and load those in your player routine.

I will experiment now.
Great.

Knowing that a pc program can write the samples in raw form saves a lot of work.

I still plan to make a sample player that uses 4-bit samples as an example for others to see, but this info will now save me lots of time generating the original sample data.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.119
  • Country: fr
  • Liked: 1051
  • Likes Given: 152
Re: How to create digidrums?
« Reply #18 on: 20:53, 26 May 10 »
>And why not use the routines from the master himself?
The code is not optimised, it was more a tutorial about digidrums. But if that's the only thing you're doing in a frame, it's enough.
Trg.Aks
Targhan/Arkos

Arkos Tracker 2 - alpha 9 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 mr_lou

  • 6128 Plus
  • ******
  • Posts: 3.063
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1225
  • Likes Given: 2465
Re: How to create digidrums?
« Reply #19 on: 20:58, 26 May 10 »
The code is not optimised

I'll leave that to the real coder, if I ever manage to create something using digidrums. For now I just want to experiment and see what I can do with it.
Currently still at the first step: Finding a tool for Linux that lets me save my mono 8bit wav file as unsigned raw.

Offline mr_lou

  • 6128 Plus
  • ******
  • Posts: 3.063
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1225
  • Likes Given: 2465
Re: How to create digidrums?
« Reply #20 on: 22:32, 26 May 10 »
Ok, gotten a little further. Have tested with 3 audio forms:
1) 8bit unsigned raw
2) 8bit signed raw
3) 8bit unsigned wav

When testing I'm just using the DIGIDRUM basic loader from the STarKos DSK, and replacing the loading of the BDLXS.SPL with my own file.
In all 3 cases it seems to load fine, but it only plays the beginning of the file, as if digidrums always have a certain length. Can this be? Are digidrums always only the same length as a single row in the SKS file?
« Last Edit: 22:50, 26 May 10 by mr_lou »

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.119
  • Country: fr
  • Liked: 1051
  • Likes Given: 152
Re: How to create digidrums?
« Reply #21 on: 22:50, 26 May 10 »
Mmmmh... do you know what you're really doing ? :)


The AY play samples is done by switching volumes very quickly (just like any sample player on any machine), from 0 to 15. That's what unsigned signal is doing. Signed signal would mean from -8 to 7. If you send such values to the AY, it won't mean a thing to him, ignoring the highest quarter (-8 -> #f8 in hex -> Hardware envelope ON as bit 4 is ON, so volume is ignored... Nothing musical).
Like I said earlier, the WAV header is tiny, so you will probably not notice it at the beginning of a digidrum sample (you WILL if you're playing a musical instrument, like a piano, and so on). Using a RAW file is cleaner, and shorter.
Also, I suggest you have a look at the source file of  STK_Digidrums.asm: the length of each sample is indeed hardcoded. You have to compile the source if the size of a sample changes. This has NOTHING to do with the SKS file, or the STarKos player which only send MESSAGES to anyone who wants to hear it (Digidrum.mxm captures the message).
In StarKos 1.2, STK_Digidrums.asm :
ADDRUM equ #2000   ;Address of the samples
ADSNARE equ #2500

SZDRUM equ #280    ;Size of the samples
SZSNARE equ #1f0

Address and size of each sample are hardcoded.


Trg.Aks
Targhan/Arkos

Arkos Tracker 2 - alpha 9 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 mr_lou

  • 6128 Plus
  • ******
  • Posts: 3.063
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1225
  • Likes Given: 2465
Re: How to create digidrums?
« Reply #22 on: 22:53, 26 May 10 »
In StarKos 1.2, STK_Digidrums.asm :
SZDRUM equ #280    ;Size of the samples
SZSNARE equ #1f0

Address and size of each sample are hardcoded.

Ah bummer. I guess there's no way around the compiler for me then.  :-X
Thanks again.

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.119
  • Country: fr
  • Liked: 1051
  • Likes Given: 152
Re: How to create digidrums?
« Reply #23 on: 23:00, 26 May 10 »
Why ? You can use another compiler if you want. I guess SJasmPlus works on Linux and could compile that easy.
Targhan/Arkos

Arkos Tracker 2 - alpha 9 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 mr_lou

  • 6128 Plus
  • ******
  • Posts: 3.063
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1225
  • Likes Given: 2465
Re: How to create digidrums?
« Reply #24 on: 23:10, 26 May 10 »
"the compiler" = any compiler

What I mean is, that I prefer to avoid the coding/compiling part. But I'll probably figure it out. After all, I did manage to code Sort'em a while back.

Anyway, next silly question:
Is there any hardcoded value that sets the frequency as well? For example, the wav file I'm experimenting with is 4000hz.

EDIT: I see line 176 and 189 has values for 8khz and 6khz. I don't suppose 4khz would happen to be 80 in line 176 and 160 in line 189?
« Last Edit: 23:31, 26 May 10 by mr_lou »