Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > samples
2021-09-12 03:20
ws

Registered: Apr 2012
Posts: 228
samples

ok, so, a long time ago, i did this:
http://dl.dataelephant.net/wl-hitormiss.prg <-- main prg (yes, it has a sample of hit or miss by ilovefriday, ffs.)

the audio data of which is built upon this script:
http://dl.dataelephant.net/conv16to8samp_unsignedraw_HITORMISS...
which converts this raw data to "c64 hi-lo-nybble 4-bit": http://dl.dataelephant.net/hitormiss8khz8bitunsigned.raw

my c64 prg uses a "mahoney-style" SID-setup and writes values to d418 in a "as fast as possible, because additional code" loop..

;--gethi    lda   ($fe),y ;load hi-lo nybble merged sample
            pha           ;store for lo-nybble later usage

processhi   lsr
            lsr
            lsr
            lsr
(..)
            sta   $d418
(..)

;-- getlow  pla 
            and   #$0f
(..)
            sta   $d418
(..)
            bne   loop

(..) = interim stuff, sprite coords writing.



the question is - why is there this modulation in my sample output? i tried so many things to alter the d418 writing, i just don't understand where the frequency modulation is coming from. (see .prg link above) for example the voice sounds like it has a 50-60-hz modulation to it. i'd rather have it more noisy like in: Der rosarote Panther
where in contrary the noise is very extreme. what am i doing wrong?
i also fail to understand the code .. is this also some 4-bit decoding thing? or 5bit? what is with the adc #$02??

$0a59 LDA #$01
$0a5b BIT $DD0D
      BEQ $0A5B ; some timer thing obviously
      LDA #$00  ; ...
      ROL $07   ; this obviously contains sample data every loop
      ROL       ; okay another bit up the hill
      ROL $07   ; okay get another bit in (is this "scaling"?)
      ROL       ; ye
      ROL       ; ah... 
      ADC #$02  ; ? why ?
      STA $D418



the noise level of the pink panther sample is extreme, but i don't understand why it doesn't have the modulation problem of my attempt. (or does it? is this normal?)

roast me.

best
WS
2021-09-12 03:53
ws

Registered: Apr 2012
Posts: 228
for a moment i had doubts if it might be the sub bass of the tune that might cause the modulation but no, it must be something i'am doing wrong.

http://dl.dataelephant.net/wl-hitormiss-hipass.prg

(frequencies removed below 150 hz to avoid too much amplitude modulation, but that is obiously not my problem)
(also yes, this is a bit slower since i had to make sure d000 read is covered since this is the longer version of the sample)
2021-09-12 04:25
ws

Registered: Apr 2012
Posts: 228
in the name of science, here is the 16 bit mono wav loop, zip pw is missya
http://dl.dataelephant DOT net/hit-r-misz.zip
2021-09-12 07:37
Oswald

Registered: Apr 2002
Posts: 5017
your d418 writes are not evenly spaced (cycles between them in the main loop), maybe that is the problem ?
2021-09-12 11:32
tlr

Registered: Sep 2003
Posts: 1714
I agree with Oswald. If you have unevenly spaced $d418 writes you are going to introduce a modulation.

When you do the playback using a timed loop like in the original post, if you have the screen open and/or sprites enabled you will get quite large timing glitches because of badlines. This will introduce even bigger modulation.

The Paulchen Panther playback routine you posted seems to use a timer to pace the writes. This will keep the average timing correct, but you will still have problems with badlines if not care is taken to deliberately have the writes miss those.

That code is using 2-bit samples with the $d418 values mapped to 2,4,6 and 8.
2021-09-12 11:36
Krill

Registered: Apr 2002
Posts: 2839
There seem to be a lot of variables here you want to rule out.

To get down to this, first you should reduce everything to just the sample routine, screen and sprites off, with stable replay points for your samples.
Your actual replay rate should match the expected replay rate as implicit in your converted samples, and yes, as Oswald mentioned, the same number of cycles between any two sample writes.

One little thing i don't get is your mention of "Mahoney-style" SID-setup. What is that? :) You're replaying good old 4-bit samples, not using Mahoney's novel approach.
2021-09-12 14:18
ws

Registered: Apr 2012
Posts: 228
Thank you so much. Now i finally understand. And now i also finally understand that timing is of the essence in nearly every case on the c64. I really erroneously believed the SID was somehow independent of that.

And about the "mahoney style setup", i believed that was the current way to set up the sid for not having to use a high-freq-carrier-sound. But again, that was a misunderstanding.
I somehow also didn't fully understand how to use his "new" method with the clicks, i remember now and that setup was just some sort of leftover, that seemed to work somehow, magically.

Well you never know how much you don't know. Sheesh.
I will now go & try & fix all of these things.
Thanks alot, guys!
2021-09-12 14:27
Krill

Registered: Apr 2002
Posts: 2839
Note that you can have stable sample replay with screen and sprites enabled.
But this requires carefully designing your player routine (and sample replay rate) around the DMA slots for badlines and sprites.

(Also note that things like sprite gaps exists to make for stable timing regardless of certain sprites being enabled/active in a rasterline or not.)
2021-09-14 21:23
Pex Mahoney Tufvesson

Registered: Sep 2003
Posts: 50
ws: I agree with Krill. Make a small routine with $d011 set to screen disabled. Then, start counting clock cycles in your loop. The writes to $d418 needs to be in perfect distance from eachother.

Then, of course, there are many nice tricks you can do to improve this. The most advanced I've done is enable screen (which steals ~40 clock cycles every 8'th raster line), and use moving sprites on screen - while playing samples in 60kHz. This was done in the demo We are Demo: We Are Demo ...the trick there was to profile the code and use the vice emulator monitor to get an exact clock cycle number for _every single write_ to $d418. Then, use this list of timings for those 15000 writes and adjust the encoding of the samples to align despite those missed clock cycles.

Abouth "Mahoney-style" samples: what I did was improve the 4-bit sample playing to somewhere around 6.5-bit using imperfections in the filters. But that's another story.

---
Have a noise night!
http://mahoney.c64.org
2021-09-15 15:54
ChristopherJam

Registered: Aug 2004
Posts: 1378
Quoting Pex Mahoney Tufvesson
Then, use this list of timings for those 15000 writes and adjust the encoding of the samples to align despite those missed clock cycles.


Haha I'd been wondering about doing something like that. Of course Pex got there first! Respect as always :)
2021-10-24 17:51
DeMOSic

Registered: Aug 2021
Posts: 126
Quote: ok, so, a long time ago, i did this:
http://dl.dataelephant.net/wl-hitormiss.prg <-- main prg (yes, it has a sample of hit or miss by ilovefriday, ffs.)

the audio data of which is built upon this script:
http://dl.dataelephant.net/conv16to8samp_unsignedraw_HITORMISS...
which converts this raw data to "c64 hi-lo-nybble 4-bit": http://dl.dataelephant.net/hitormiss8khz8bitunsigned.raw

my c64 prg uses a "mahoney-style" SID-setup and writes values to d418 in a "as fast as possible, because additional code" loop..

;--gethi    lda   ($fe),y ;load hi-lo nybble merged sample
            pha           ;store for lo-nybble later usage

processhi   lsr
            lsr
            lsr
            lsr
(..)
            sta   $d418
(..)

;-- getlow  pla 
            and   #$0f
(..)
            sta   $d418
(..)
            bne   loop

(..) = interim stuff, sprite coords writing.



the question is - why is there this modulation in my sample output? i tried so many things to alter the d418 writing, i just don't understand where the frequency modulation is coming from. (see .prg link above) for example the voice sounds like it has a 50-60-hz modulation to it. i'd rather have it more noisy like in: Der rosarote Panther
where in contrary the noise is very extreme. what am i doing wrong?
i also fail to understand the code .. is this also some 4-bit decoding thing? or 5bit? what is with the adc #$02??

$0a59 LDA #$01
$0a5b BIT $DD0D
      BEQ $0A5B ; some timer thing obviously
      LDA #$00  ; ...
      ROL $07   ; this obviously contains sample data every loop
      ROL       ; okay another bit up the hill
      ROL $07   ; okay get another bit in (is this "scaling"?)
      ROL       ; ye
      ROL       ; ah... 
      ADC #$02  ; ? why ?
      STA $D418



the noise level of the pink panther sample is extreme, but i don't understand why it doesn't have the modulation problem of my attempt. (or does it? is this normal?)

roast me.

best
WS


Anywhere where i can download this python script still?
 
... 18 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 | 3 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Scorpion/Contex / Ar..
kbs/Pht/Lxt
rexbeng
Guests online: 135
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 The Ghost  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.8)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Original Suppliers
1 Derbyshire Ram  (9.5)
2 Black Beard  (9.4)
3 hedning  (9.2)
4 Baracuda  (9.1)
5 Irata  (8.5)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.064 sec.