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....
 
2022-09-17 06:33
ws

Registered: Apr 2012
Posts: 228
Another n00b question :

1. While replaying samples, the oldschool way, what is the logical explanation for the fact that we're just ramping the volume of a stalled squarewave, but the actual effect is on both sides of the center line? Why is the output not on one side of the audio 0 line but in fact it is bi-polar? If the square-wave changes polarity at any time, i would even expect long parts of the wave being on the plus side and other long parts being on the minus side, depending on the base frequency of the square wave? Why is it bi-polar/balanced?

Oldschool sample-replay output example:
https://ibb.co/Y2X4G5b (wave output screenshot)

2. Also, in the above example, which is recorded from a sample replay output like 4-bit in Pink Panther fashion, why do the horizontals graviate towards the center? In a saw-tooth-ish way? Is that the decay of the ADSR?

I am happy to read about this elsewhere, i just was unable to find anything because ... how is this even called?
2022-09-17 08:18
Oswald

Registered: Apr 2002
Posts: 5017
here is my noob question, why does it work as 4th channel on a totally random volume if the other 3 is playing music :)
2022-09-17 09:21
ChristopherJam

Registered: Aug 2004
Posts: 1378
The other three have a DC component - it is the product of that with the sample that you hear as sample playback.
2022-09-17 12:50
tlr

Registered: Sep 2003
Posts: 1714
Quoting ws
Another n00b question :

1. While replaying samples, the oldschool way, what is the logical explanation for the fact that we're just ramping the volume of a stalled squarewave, but the actual effect is on both sides of the center line? Why is the output not on one side of the audio 0 line but in fact it is bi-polar? If the square-wave changes polarity at any time, i would even expect long parts of the wave being on the plus side and other long parts being on the minus side, depending on the base frequency of the square wave? Why is it bi-polar/balanced?

Oldschool sample-replay output example:
https://ibb.co/Y2X4G5b (wave output screenshot)

2. Also, in the above example, which is recorded from a sample replay output like 4-bit in Pink Panther fashion, why do the horizontals graviate towards the center? In a saw-tooth-ish way? Is that the decay of the ADSR?

I am happy to read about this elsewhere, i just was unable to find anything because ... how is this even called?

It's AC coupled. See C77 here: 250469-rev.B-right.gif
2022-09-17 19:39
Oswald

Registered: Apr 2002
Posts: 5017
Quote: The other three have a DC component - it is the product of that with the sample that you hear as sample playback.

that dont really explain it to me. I have 3 waveforms mixed, why dont I hear their volume changing, instead a 4th sample channel ?
2022-09-17 20:08
DeMOSic

Registered: Aug 2021
Posts: 126
Quote: that dont really explain it to me. I have 3 waveforms mixed, why dont I hear their volume changing, instead a 4th sample channel ?

well. There is a bug in the Old 6581 SID chip which, whenever changing the master volume, produces a click at the set volume. So you can use those clicks rapidly to make Samples.
2022-09-17 20:22
Mixer

Registered: Apr 2008
Posts: 422
https://codebase64.org/doku.php?id=base:sid_programming

Has link to some well written resources about playing samples in C-64. I recommend reading the Music Non Stop technical details by Mahoney.
2022-09-17 21:37
ws

Registered: Apr 2012
Posts: 228
Oswald: think of it as subtractive mixing. Your SID-Synth-Waves create the amplitude, from which the sample is so to speak subtracted, which kind of "distorts" the synth/music content and makes the sample hearable. The simpler your synth-sound is (that is why we use a square wave as "carrier"), the cleaner the sample sound gets.

@Mixer - thanks for that link, i totally forgot to read there.
2022-09-18 07:04
Oswald

Registered: Apr 2002
Posts: 5017
ws, yeah that makes more sense than its clicks :) still not 100% for me tho. It would be interesting to see sid output, and then same with d418 digi, fex simple triangle / pulse and then with some digi bass :)
2022-09-18 16:39
ws

Registered: Apr 2012
Posts: 228
The clicks method is the most recent method discovered by Mahoney "clicks came whenever I toggled a voice from being routed through the analog filter of the SID chip, or not",
but what we have mostly talking about here is the good old d418 volume change method, that is disliked for its low quality and non-good-results on the new SID, because the 8580 has DC-Offset correction, so that the amplitude's null line is now correctly being centered, resulting in samples being very quiet if played with the old volume method.
all details are here: https://livet.se/mahoney/c64-files/Musik_RunStop_Technical_Deta..
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
rexbeng
Krill/Plush
ice00/Ice Team
WVL/Xenon
Linus/MSL
Guests online: 152
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 Wonderland XIV  (9.6)
9 Bromance  (9.6)
10 Memento Mori  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
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 Crackers
1 Mr. Z  (9.9)
2 S!R  (9.9)
3 Antitrack  (9.8)
4 Mr Zero Page  (9.8)
5 OTD  (9.8)

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