| |
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 |
|
| |
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) |
| |
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 |
| |
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 ? |
| |
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. |
| |
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. |
| |
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! |
| |
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.) |
| |
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 |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1378 |
Quoting Pex Mahoney TufvessonThen, 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 :) |
| |
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 |