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
 
... 18 posts hidden. Click here to view all posts....
 
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?
2022-09-09 08:11
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!]
2022-09-09 10:41
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.
2022-09-09 18:53
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.
2022-09-10 11:11
Krill

Registered: Apr 2002
Posts: 2839
Quoting wacek
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.
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. =)
2022-09-10 12:09
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..
2022-09-10 12:18
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))
2022-09-10 12:25
Krill

Registered: Apr 2002
Posts: 2839
Quoting ChristopherJam
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..
True that. It was early... :)
2022-09-10 14:29
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
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
wil
Apollyon/ALD
kbs/Pht/Lxt
tlr
Didi/Laxity
Fungus/Nostalgia
Trap/Bonzai
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 Diskmag Editors
1 Jazzcat  (9.4)
2 Magic  (9.4)
3 hedning  (9.2)
4 Newscopy  (9.1)
5 Elwix  (9.1)

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