| |
Martin Piper
Registered: Nov 2007 Posts: 699 |
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.... |
| |
tlr
Registered: Sep 2003 Posts: 1762 |
Quote: Quoting tlrIf 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. |
| |
Krill
Registered: Apr 2002 Posts: 2940 |
Quoting tlrI 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. |
| |
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). =) |
| |
Martin Piper
Registered: Nov 2007 Posts: 699 |
Quote: Quoting Martin PiperAccuracy 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. |
| |
Martin Piper
Registered: Nov 2007 Posts: 699 |
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. |
| |
Martin Piper
Registered: Nov 2007 Posts: 699 |
Quote: Quoting tlrI 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. |
| |
Martin Piper
Registered: Nov 2007 Posts: 699 |
Improved sample rate. Same instructions and links as post #16 above...
Download this PRG: https://github.com/martinpiper/C64Public/raw/master/IRQTape/Tap..
Download this TAP file: https://github.com/martinpiper/C64Public/raw/master/IRQTape/vic..
You should see narrow colour bars indicating the volume this time. This time it's using "Tom's Diner". |
| |
tlr
Registered: Sep 2003 Posts: 1762 |
Quoting KrillQuoting tlrI 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.
My assumption is based on the fact that the spectrum of typical songs falls off towards high frequencies, thus the changes of higher frequency would statistically have smaller steps.
This can of course be tested with some actual data.
Quoting KrillAnd on another thought... differential encoding alone would have to rely on lossless/error-free encoding, lest it degrade quickly (without some intermediate absolute literals).
yes, errors would be handle badly. |
| |
tlr
Registered: Sep 2003 Posts: 1762 |
Quote: 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.
My idea was to not only encode +1 and -1, but 0, +1, -1, +2, -2 and perhaps more as single pulses. The reasoning behind this is that the difference between the pulses need not be a multiple of the shortest one. |
| |
Hoogo
Registered: Jun 2002 Posts: 103 |
Quote: Quoting Martin PiperAccuracy 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)? =)
At least to test jitter. Iirc, 95% Jitter is surprisingly small, within a 6 cycle window. But the other 5% are far off, so you have to increase your pulse lengths. And if you want to write with a PC, you will stick to 44100 anyways.
But why is there so much noise in this sample?? |
Previous - 1 | 2 | 3 | 4 | 5 - Next |