| |
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 |
|
... 18 posts hidden. Click here to view all posts.... |
| |
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? |
| |
ws
Registered: Apr 2012 Posts: 228 |
https://dl.dataelephant.net/conv8bitwavto4bitc64.zip
just for the fun. it is a win32 blitz3d exe now (works on win10), because there are just too many aspects of python that i actually hate. ( _yes_ .bb source with all my super terrible code is included, enjoy. )
the prerequisites should be doable in soundforge or audacity, whathaveyou. maybe i'll go the full lenght and write a wav importer -- but if you're preparing your sample in a sophisticated editor anyways... why not save it in the way thats required.
yes, the 2 demos are with d011 blanked, because i didnt care to add gfx. enabled screen just makes the crappy sound a bit more crappy.
[Edit: also ofcourse big thx to tlr, oswald, krill & mahoney for helping me understand this!] |
| |
wacek
Registered: Nov 2007 Posts: 501 |
Mahoney's method is pretty resistant to inconsistent write jitter to my experience ;)
My simple ways to go around the badlines without too much hard work regarding timing (and with screen turned on) was going every 2nd line skipping the badlines altogether. If I did it in simple wait loop, or via retriggered IRQs, doesn't matter, the code was simpler that way. |
| |
ws
Registered: Apr 2012 Posts: 228 |
@wacek : sounds interesting! would you care to provide an example to look at? Maybe this thread can accumulate some helpful approaches. |
| |
Krill
Registered: Apr 2002 Posts: 2839 |
Quoting wacekMy simple ways to go around the badlines without too much hard work regarding timing (and with screen turned on) was going every 2nd line skipping the badlines altogether. With a CIA timer interrupt firing at the start of the right-hand border, you have about 23 cycles for the sample replay interrupt handler until badline DMA.
I wonder if it's possible to have a sample rate of 15.6 KHz (one sample per rasterline) and normal badline action with that. =) |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1378 |
Well, one could always just not RTI after playing the sample at the end of line 7, and just set up to play the end-of-line-0 sample 23 cycles later.. |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1378 |
Oh, and also cf The Brothers Gonna Wr4k It Out (100%) which plays back two samples every IRQ, with an interrupt every 168 cycles (2.67 rasters) to achieve 11.7KHz playback without disabling badlines.
(more details in the release notes for (old CIA edition)) |
| |
Krill
Registered: Apr 2002 Posts: 2839 |
Quoting ChristopherJamWell, one could always just not RTI after playing the sample at the end of line 7, and just set up to play the end-of-line-0 sample 23 cycles later.. True that. It was early... :) |
| |
The Human Code Machine
Registered: Sep 2005 Posts: 110 |
There's enough time for 15,6Khz even when badlines are enabled, but you have to trigger the NMI IRQ at the right spot , the NMI code has to be in zeropage and shouldn't use more cycles than here:
nmiplaybuf sta abuf+1
fetch lda mixingbuffer1
sta $d418
inc fetch+1
abuf lda #$00
jmp $dd0c ;clear NMI IRQ flag and rti
I used this code in C=Bit 18. 11,7Khz is also possible with badlines enabled, just have a look at the concert part of Musik Run/Stop. |
Previous - 1 | 2 | 3 - Next |