News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_mr_lou

How to create digidrums?

Started by mr_lou, 12:12, 25 May 10

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Targhan

That's really a crappy code :). The sample code takes 28 cycles, to which you add NOPS. For 8 khz sample, a sample must be played every 128 nops. For 16khz, every scanline (64 nops). The calculation is up to you :)
I however decreased these number because of the STarKos player, which takes about 35 scanlines.
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

mr_lou

Quote from: Targhan on 21:42, 26 May 10
That's really a crappy code :)

Er, what is? Your example code, or my estimate?

Please understand, that I have no idea what a NOPS is or the likes. I compose music. I can't code assembler.

Just now I tried compiling your code with pasmo, resulting in having to insert ; everywhere to comment out the....comments. I'm using the DAM variant (instead of MXM), since pasmo seemed to like that one most. (I have no clue what DAM or MXM is either).

I'm only interested in one thing: Experiment to see what kind of quality I can squeeze out of digidrums. So I'll see if I can edit that source code now to contain only 1 sample, and then take it from there.

Targhan

Oh, don't worry, I was talking about my code :).
You should use the .asm that you can find on the STarKos website, I think it's cleaner.
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

mr_lou

Quote from: Targhan on 22:17, 26 May 10
Oh, don't worry, I was talking about my code :) .
You should use the .asm that you can find on the STarKos website, I think it's cleaner.

I took a look at the source that's on the website, but trying to compile that with passmo gives me other problems, like it complains that the label "nolist" has already been defined...tsk.

I've had somewhat success with the DAM source. But both the sample and tune is playing way too slow. I suspect it's because the track I'm using is a 100hz one, and the default playback is 50hz? But I can't find anywhere in the player source where I set this.

Anyway, time to call it a day. G'nite.

Targhan

Remove the "list"/"nolist", they're just Maxam mnemonics to start/stop the listing display.
About the frequency, yes, only 50hz. If you want 100 hz, the most simple way to do this is to remove the VSync loop and play twice less samples ! This way, your song will be "almost" at 100hz.
Trg.Als
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

mr_lou

Nevermind.

I was using the PLAYASM9.BIN from a previous version of STarKos, and that seemed to be the cause.
Generating a new player with GP solved it at least.

Now to find out why my samples are just noise....   ::)

mr_lou

Been experimenting quite a bit now. My thought was that I could put a chord into the digidrum, instead of a drum.
So I've tested with a simple square sample now, and find that it's not precisely playing back at 8khz.

Is there any way of knowing precisely what the playback frequency is, when we use 160 samples per VBL and waiting 80 nops?

Targhan

Yes. Count the cycles. In theory : (64*312) / time of the replay routine (=28 cycles for the replay + the nops) * 50. So if you're playing every scanline (every 64 nops), you'll get a 15600hz replay frequency.
However, with this code, it will be lower, as we lose some time playing the STarKos player. To play a musical instrument, 8Khz is not a lot. And like I said earlier, it will sound bad because while the STarkos player is called, no sample is played. That's why this code is only useful for digidrums. For example, for the "landscape" part of the Demoizart, you can hear both digi+FM. But the players I did were micro coded to allow me to play the samples EVERY scanline. You may not be able to do what you want with the current player. Switching to Arkos Player tracker may improve the result as it is faster, but...


Oh by the way, did you make sure that you were increasing/decreasing the "ld c,120" just above the PTSPL label ? It's how many sample you're reading per VBL. It has to be as high as possible ! (the raster must fill the screen)
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

mr_lou

Quote from: Targhan on 10:45, 28 May 10
Iit will sound bad because while the STarkos player is called, no sample is played. That's why this code is only useful for digidrums. For example, for the "landscape" part of the Demoizart, you can hear both digi+FM. But the players I did were micro coded to allow me to play the samples EVERY scanline. You may not be able to do what you want with the current player.

So code me another player you lazy geek.  :)

I hear what you mean. It's quite easy to hear that the sample-playback is constantly interrupted. But besides that, there's also way too much noise. I did expect noise, but not this much.
I was thinking, that if the sample was simple, like e.g. a square synth, then we'd be "safe". So I tried making a chord of square synths, giving roughly 5 different positions of the wav.
So I changed the CONVTAB so that there only was 5 volumes.
Everything from 0 to 48 = 0
Everything from 49 to 80 = 6
Everything from 81 to 144 = 9
Everything from 145 to 176 = 12
Everything from 177 to 255 = 15

I thought I could get a cleaner square sound this way, but no. I'm drowning in noise.

So I see what you mean about the digidrum feature mostly being useful for actual drums, and not much else.

Quote from: Targhan on 10:45, 28 May 10
Oh by the way, did you make sure that you were increasing/decreasing the "ld c,120" just above the PTSPL label ? It's how many sample you're reading per VBL. It has to be as high as possible ! (the raster must fill the screen)

Yup

Targhan

My advice is :
- You code another player by yourself :).
- You could also use a very fast player like madram's AYC player. It's more stable and takes about 10 scanlines (you'll have trigger the digidrums by yourself though).
- You ditch the StarKos player and do samples only. Prodatron manages to get a "decent" quality in the Digital orgasm thanks to that (though the music is cut by the 6 interruptions code, fortunately they're tiny, except for the scroller).
Trg.Aks
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

mr_lou

I wouldn't know how to code my own player.

I'm in the process of getting myself a Digiblaster, and then I will experiment with Digitracker. Till then I just wanted to see what STarKos could do. Now I know.

Thanks for the help.

Grim

Maybe you should PLOT your samples on the screen and see if the wave-form you get is as you expect it to be. For example, the small program below will load a sample and display the first 640 values (enough to do the check).

10 MODE 2:MEMORY &3FFF:LOAD"bassdrum.spl",&4000
20 FOR x=0 to 640:DRAW x,PEEK(&4000+x):NEXT


With drums, the waveform usually is clearly recognizable. So, if you don't see it, call Houston.

Also, do not waste your time trying to produce a normalized sample for the AY. The logarithmic DAC outputs will mutilate it anyway. Do not hesitate to boost heavily (read: saturate) the volume of your sample.

mr_lou

Quote from: Grim on 16:21, 28 May 10
Maybe you should PLOT your samples on the screen and see if the wave-form you get is as you expect it to be.

That was a good idea. I expanded that program, so that it poked new values in order to get a more clean synth, and then saved the file again. There's still way too much noise though, and I don't think it improved anything, because the converter-table in the source should take care of that part already...
But the plot showed me that the file was as it was supposed to be.

Quote from: Grim on 16:21, 28 May 10
Also, do not waste your time trying to produce a normalized sample for the AY. The logarithmic DAC outputs will mutilate it anyway. Do not hesitate to boost heavily (read: saturate) the volume of your sample.

mkay thanks. I'll test this.


Targhan, can we have some specs for the SKI format? I want to experiment creating instruments externally.

Powered by SMFPacks Menu Editor Mod