Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user jmi ! (Registered 2024-09-15) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Sample streaming from tape
2023-10-31 04:25
Martin Piper

Registered: Nov 2007
Posts: 698
Sample streaming from tape

Has anyone done four bit sample streaming from tape before? I'm thinking the time between pulses can be directly translated to four bit volume values as they are read from tape.
Practically useless, except for pure geekyness. But I wanted to know if it's been done, before I do it myself.
 
... 36 posts hidden. Click here to view all posts....
 
2023-11-11 02:39
Martin Piper

Registered: Nov 2007
Posts: 698
The code changes for this example. https://github.com/martinpiper/C64Public/compare/e7dc2ef85d1c72..

Accuracy would be improved by using an IRQ instead of polling bit 4 on $dc0d.
2023-11-11 12:03
tlr

Registered: Sep 2003
Posts: 1762
Would be interesting to see how this works on real HW. If you just translate pulse length to sample value, then any imperfections in detecting the length will translate to some noise which is probably unproblematic.

This encoding is basically frequency modulation (as in FM radio).

If you accept relying on precise pulse length detection, then you could employ a differential encoding instead, e.g 0, +1, -1, +2, -2... This way you could choose to have a higher sample rate for small changes, improving high frequency content of the sound.
2023-11-11 12:32
Krill

Registered: Apr 2002
Posts: 2940
Quoting Martin Piper
Accuracy would be improved by using an IRQ instead of polling bit 4 on $dc0d.
Main thread running over a thousand NOPs, interrupt kicks in, does stuff, and jumps back to start of NOP desert.

Did any tape loaders use this to improve accuracy (= increase bit rate)? =)
2023-11-11 12:39
Krill

Registered: Apr 2002
Posts: 2940
Quoting tlr
If you accept relying on precise pulse length detection, then you could employ a differential encoding instead, e.g 0, +1, -1, +2, -2... This way you could choose to have a higher sample rate for small changes, improving high frequency content of the sound.
Hmm... wouldn't the larger diffs imply a steeper gradient on the time-domain wave, and thus should be encoded with the shorter pulses?
2023-11-11 12:57
tlr

Registered: Sep 2003
Posts: 1762
Quote: Quoting tlr
If you accept relying on precise pulse length detection, then you could employ a differential encoding instead, e.g 0, +1, -1, +2, -2... This way you could choose to have a higher sample rate for small changes, improving high frequency content of the sound.
Hmm... wouldn't the larger diffs imply a steeper gradient on the time-domain wave, and thus should be encoded with the shorter pulses?


I would think that higher frequency content has lower amplitude in general, but feel free to experiment for optimum results.
2023-11-11 13:11
Krill

Registered: Apr 2002
Posts: 2940
Quoting tlr
I would think that higher frequency content has lower amplitude in general, but feel free to experiment for optimum results.
I wouldn't. :)

Gutsfeeling says there's some kind of optimum to be achieved by having a special switch-token pulse length to flip between the two (apparently concurrent) goals, though.
2023-11-11 13:29
Krill

Registered: Apr 2002
Posts: 2940
And on another thought... differential encoding alone would have to rely on lossless/error-free encoding, lest it degrade quickly (without some intermediate absolute literals).

This sort of application, however, has no need to reliably tell apart symbols, unlike tape loaders.

So, it's probably a good idea to have some encoding that forgives the random blooper (and allows for higher bitrates/tighter symbol packing at the cost of some noise). =)
2023-11-11 14:06
Martin Piper

Registered: Nov 2007
Posts: 698
Quote: Quoting Martin Piper
Accuracy would be improved by using an IRQ instead of polling bit 4 on $dc0d.
Main thread running over a thousand NOPs, interrupt kicks in, does stuff, and jumps back to start of NOP desert.

Did any tape loaders use this to improve accuracy (= increase bit rate)? =)


Yeah, it does reduce jitter, which allows the pulse lengths to be shorter. At the moment I'm using 16 cycles, if it could be brought down to 8 cycles reliably this would improve sample quality.
2023-11-11 14:08
Martin Piper

Registered: Nov 2007
Posts: 698
Quote: Would be interesting to see how this works on real HW. If you just translate pulse length to sample value, then any imperfections in detecting the length will translate to some noise which is probably unproblematic.

This encoding is basically frequency modulation (as in FM radio).

If you accept relying on precise pulse length detection, then you could employ a differential encoding instead, e.g 0, +1, -1, +2, -2... This way you could choose to have a higher sample rate for small changes, improving high frequency content of the sound.


My C2N is dead. If someone can try on real hardware and let me know that would be great. At the moment I'm using Vice with tape wobble at 10, which still sounds OK.
2023-11-11 14:14
Martin Piper

Registered: Nov 2007
Posts: 698
Quote: Quoting tlr
I would think that higher frequency content has lower amplitude in general, but feel free to experiment for optimum results.
I wouldn't. :)

Gutsfeeling says there's some kind of optimum to be achieved by having a special switch-token pulse length to flip between the two (apparently concurrent) goals, though.


I might try, delta pulse lengths for +1 and -1, and no change could be any longer pulse, which would allow consecutive unchanged samples to just use one pulse of a long length instead of having to encode "0" often.
Then every 16/32/64 samples read the full 4 bit token to reset any delta read errors.
Previous - 1 | 2 | 3 | 4 | 5 - 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
E$G/HF ⭐ 7
alwyz/udi
MWR/Visdom
cobbpg
Scooby/G★P/Light
Jedfox/Exclusive ON
bugjam
Tommy/Noice ^ Dual C..
Steffan/BOOM!
Mason/Unicess
zscs
wbochar
Jetboy/Elysium
Guests online: 145
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Mojo  (9.6)
6 Uncensored  (9.6)
7 Wonderland XIV  (9.6)
8 Comaland 100%  (9.6)
9 No Bounds  (9.6)
10 Unboxed  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Party Elk 2  (9.6)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.6)
5 Rainbow Connection  (9.5)
6 It's More Fun to Com..  (9.5)
7 Dawnfall V1.1  (9.5)
8 Onscreen 5k  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Morph  (9.5)
Top Groups
1 Booze Design  (9.3)
2 Oxyron  (9.3)
3 Nostalgia  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.2)
Top Webmasters
1 Slaygon  (9.6)
2 Perff  (9.6)
3 Morpheus  (9.5)
4 Sabbi  (9.5)
5 CreaMD  (9.1)

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