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.
2023-10-31 13:30
chatGPZ

Registered: Dec 2001
Posts: 11290
I think i have seen something like that back in the days. No idea if that worked with special prepared data though

Why limit it to 4 bit though?
2023-10-31 13:52
Repose

Registered: Oct 2010
Posts: 225
Interesting idea. I've done something related; just play a tape and listen to the read bit. You can hear 1-bit music this way.
2023-10-31 13:55
chatGPZ

Registered: Dec 2001
Posts: 11290
THAT was all over the mags back in the days :)
2023-10-31 14:39
Martin Piper

Registered: Nov 2007
Posts: 698
Quote: Interesting idea. I've done something related; just play a tape and listen to the read bit. You can hear 1-bit music this way.

1 bit is different. :)

I'm thinking 4-bit to use the full SID volume range.

Instead of trying to binary encode the 4 bits used for the SID volume, I'm thinking use pulse length to fill the number range from 0 to 15 (4 bits) volume.
This means creating a tape with 16 different pulse lengths basically.
2023-10-31 15:03
tlr

Registered: Sep 2003
Posts: 1762
I think ”Pulse” by pixel for the vic-20 uses this technique for music playback somewhere in the loading sequence.
2023-10-31 16:20
Repose

Registered: Oct 2010
Posts: 225
So the question is, what's the max frequency of pulses you can read? Based on the music I heard, it seems at 1kHz. Your average pulse length would be 8, so your sample rate would only be 128Hz.
Or look at it this way, to get phone quality sample rate (8kHz), you'd need pulses at 64KHz. I'm pretty sure that's not possible.
In fact, your encoding method is not efficient. You face the same tradeoffs as disk encoding. It's only that pulse length can give the wrong value with a slightly different speed, but that's hidden due to the nature of audio.
If you write 1/0 directly with occasional sync, that's most efficient, then the factor is only 4 instead of 8.
This is still a very low sample rate. If you get fancy with ADPCM, you could do at best 2x ratio.
This concept could only play bass/drums at best.
The best system I could imagine is using some DSP to find a combo of SID waveforms as a basis function to recreate the psychoacoustically most relevant frequencies, then the sample rate needs to be more related to how quickly the sound changes, and you could get something like the "mp3" demo.
But for normal coders, basically just d'n'b.
2023-10-31 16:24
Repose

Registered: Oct 2010
Posts: 225
On 2nd thought, I estimated pulse speed in a very poor way. Looking at typical tape response, a cheap tape deck would do 10kHz, so somewhere below that. That's still pretty poor sampling rate.
2023-10-31 17:21
MagerValp

Registered: Dec 2001
Posts: 1065
Use Macbeth's delta encoding instead (0/+1/-1), it only requires three different pulses.
2023-10-31 19:17
Frantic

Registered: Mar 2003
Posts: 1641
Vaguely related. Video streaming from tape:

Deep Throat
2023-11-01 14:39
Martin Piper

Registered: Nov 2007
Posts: 698
Quote: So the question is, what's the max frequency of pulses you can read? Based on the music I heard, it seems at 1kHz. Your average pulse length would be 8, so your sample rate would only be 128Hz.
Or look at it this way, to get phone quality sample rate (8kHz), you'd need pulses at 64KHz. I'm pretty sure that's not possible.
In fact, your encoding method is not efficient. You face the same tradeoffs as disk encoding. It's only that pulse length can give the wrong value with a slightly different speed, but that's hidden due to the nature of audio.
If you write 1/0 directly with occasional sync, that's most efficient, then the factor is only 4 instead of 8.
This is still a very low sample rate. If you get fancy with ADPCM, you could do at best 2x ratio.
This concept could only play bass/drums at best.
The best system I could imagine is using some DSP to find a combo of SID waveforms as a basis function to recreate the psychoacoustically most relevant frequencies, then the sample rate needs to be more related to how quickly the sound changes, and you could get something like the "mp3" demo.
But for normal coders, basically just d'n'b.


Eh? On PAL, for 8KHz I'd need a pulse every ~123 cycles, right? Assuming one tape pulse encodes one SID volume store of 4 bits.

The TAP file format has a resolution of 8 cycles, so each of the 16 SID volume levels would be, in the TAP file, a pulse length of X to X+15. Where X is a lower boundary constant to allow enough cycles to trigger on tape pulse, read the pulse length with a CIA timer, reset the timer, store to SID, loop...

So in reality the tape pulses in cycle terms could be 64 to 192 cycles to map directly to volume levels 0 to 15. Even an upper limit of 192 cycles would, in PAL, give 5131 Hz, right?
 
... 36 posts hidden. Click here to view all posts....
 
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
TheRyk/MYD!
Scooby/G★P/Light
pby/HF/Acrise
bugjam
Thierry
dstar/Fairlight
Brush/Elysium
lucommodore
Matt
megasoftargentina
Higgie/Kraze/Slackers
-trb-
icon/The Silents, Sp..
Pajda/Faith Design
Avalanche/Atlantis
Da Snake
REBEL 1/HF
Courage
Guests online: 141
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 Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 hedning  (9.7)
4 Irata  (9.7)
5 Tim  (9.7)

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