Login
Back to forumReply to this topicGo to last reply

Posted By

Volker_D
on 2024-12-11
17:17:52
 "Streched out" tapes

Hallo guys,

I am novice, so maybe I am totally wrong:
I try to convert some old c16 tapes, but failed. Other guys told me, that the tape is stretched out and can't be read anymore.

So now my question (maybe I am totally wrong):
Stretched out means, that the tape is longer then before, so the sound (note) is lower than normal?!
If the answer is yes:
Doesn't that mean that you only need to measure the first notes. They should have a fixed frequency. So you only need to measure the new sound and then can calculate the old one. So you know how to undo the stretch of the whole tape.

Does tools like wav2tape try to do something like that automatically?

I guess/fear the stretch of old tapes is not always the same on a single tape. Are there "rules" if the stretch is not uniform? Is there a way how to measure and undo that?

I mean for example like this:
I have an old tape and can't convert it anymore. But there is still much free space on the tape left. So my idea is just to record a fixed sound/note on that tape for maybe 1 minute or more and then read that tape again and view the just recorded note. Maybe it is possible to see rules by that how the tape stretch?

Sadly I am not skilled enough for that. Maybe my idea is totally wrong, since maybe my idea work only correct if i had done recorded that test sound 40 years ago on the tape.

Let me know what you think about my idea/questions.

Have a nice week!

Posted By

JimmyCoupe
on 2024-12-12
03:48:21
 Re: "Streched out" tapes

I can't help on the logic of stretched tapes as such but yes if the tape is stretched the sound will be all wonky so the data wouldnt be loaded correctly into the computer. I am not saying the tape is not stretched but the likely cause of your failure is not stretched tape but your backup was just taken wrongly. I have a very large retro collection with a lot of tape media and I find it far more reliable than disk. I did a project of backing up C16 tapes a few years ago and its not as simple as use a single tool. There is help on the forum as you will find my old thread somewhere but I think I used a USB tape recorder to capture the tape, then I had to use audiocity to alter the sound levels and then I converted it to a .tap. It took many goes to understand the process, C16 tapes are harder to snapshot than some computers like a Spectrum.

Posted By

Volker_D
on 2024-12-12
10:05:44
 Re: "Streched out" tapes

I tried with "Fingers Malone" and it work without any problem.
But I have some tapes that doesn't work.
I have tapes that are currently not available on plus4world, so interesting to convert them.
If anyone is interested in helping me, then please write me an email. Write to suffix "arcor.de", prefix "v_dirr" in the middle of course "@".
Thank you

Posted By

Gaia
on 2024-12-12
14:48:50
 Re: "Streched out" tapes

Do ALL your recordings load on the real iron? That's the #1 issue to start with. If not, it is highly unlikely they'll load on emulators or that they can be converted to (M)TAP. I'm not saying it's completely impossible, because theoretically one could write some clever algorithm knowing the pulse lengths and such... but such algorithms do not exist at the moment. However, in case the tapes do load on the real machine, it's almost certain that the conversion tools and/or the emulators can cope with them, too.

Posted By

Volker_D
on 2024-12-12
15:34:13
 Re: "Streched out" tapes

I will try (but I fear I must change the rubber band in my 40 years old datasetta to load in original hardware.

I read some more in other forums about audio drama and music tapes. Some of that guys even open the tape, remove the magnetic thread, bought a new tape and place the old magnetic thread into the new tape to avoid periodic speed changes.
But I fear I don't have the ease to do such a work.
hmm... I will try some more next weekend.

Posted By

Waz
on 2024-12-12
16:06:28
 Re: "Streched out" tapes

Hi Volker,

Just our of interest, which games are you looking to do the conversions of?

There are some games which use specific turbos that are recorded as "halfwave" which is a wave format unique to the C16 and Plus/4 series. There are two known hardware transfer solutions which do work properly with these - MTAP and DC2N. The remainder such as the 1530USB do not.

As @Gaia noted, you would definitely be sensible to see if the games load on the real hardware to begin with. There are plenty of 1531 cassette decks available online if you need another one (which may be a cheaper option than replacing the belt)

Posted By

Volker_D
on 2024-12-12
16:20:24
 Re: "Streched out" tapes

I just ordered new belts for 3,30€. I guess this is the cheapest version, but of course a bit work. Sadly they sent from china and delivery is expected in January. So it will take some time, since I never changed belts myself so far.
"Fingers Malone" has a turbo tape an worked fine. Since several of the other tapes are pretty long, it look like several of them doesn't use a turbo tape, but they fail sad If you want to see the wav files, just write me an email.

Posted By

Crown
on 2024-12-13
04:44:33
 Re: "Streched out" tapes

I'm also digging around in the deeper details of converting tapes and there are a few details of converting WAV files which looks suspicious to me, and doesn't really add up.
There is this concept of detecting zero crossing in the WAV signal, as the change in the digital output from 0 to 1, and 1 to 0. The actual captured WAV data and logic doesn't really support this concept.
If I look at the source of YapeSDL https://github.com/calmopyrin/yapesdl/blob/master/tape.cpp function readWavData, it does implement this. Not sure if the native Yape version has the same code. If I look at the source of WAV-PRG https://sourceforge.net/p/wav-prg/libtap/ci/master/tree/tapencoder.c tapenc_get_pulse function, it doesn't implement it as detecting crossing at exact 0 value, but tries to calculate a tap_trigger_value as the average of the current value and the previous min or max value, so it still does detecting zero-crossing but not at zero.
Can someone explain why this should be the correct conversion method?

Doing peak and through detection as trigger is more plausible for me, just by looking at the actual WAV data. Peak is simple, trough is more complex, as you have to be aware that the signal really works like a spring. It goes up if you feed it with digital 1, starts to drop when switching to 0, easing off and oscillates around 0, meaning it will go negative, but slowly the signal will dissipate, unless there is a feed of digital 1 starts it to go up again. That is the behaviour I see in the digitized signal. Where am I wrong?

There are a few things which could be measured. One thing is to create a few different short pulse combinations, write it to an actual tape with with a TapeXUM https://github.com/r1me/TapeXUM device, and sample it back as WAV.

The other thing is to connect a modern digital oscilloscope to the Read head of a 1531, before the signal processing part, I'd really like to see what's on the analog line of the Read head, as capturing WAV files can also add some artifacts.

Posted By

gerliczer
on 2024-12-13
05:49:38
 Re: "Streched out" tapes

@Crown: Maybe what you are observing is the thing @Waz was referring to as "halfwave". He also said that those are not supported by every PC tape tool. Your measurements seem to explain why.

Posted By

Crown
on 2024-12-13
06:48:20
 Re: "Streched out" tapes

No, I know exactly what halfwave is. The way the hardware driving the tape works in the C64 is that when you record a signal it consist of a high and a low part (a square wave), and the length of both is the same. While in the Plus4 you directly setting the line to the tape, so you can set the length of both individually to arbitrary length, and if you chose to not to set it the same length than that is called a halfwave. The kernal ROM writes symmetrical pulses, that's why a standard tape can work if you only capture it in fullwave mode. For everything else, you have to capture in halfwave, which means you have to record the length of every high and low part.

How the conversion of this digital signal to the analogue works is the following: when you switch to high, it starts to raise the amplitude of the analogue system, the more time you keep it high the more higher goes, it can't go infinitely high, there is resistance which slows the amount of increase with time. When you release the signal (set it to low), it snaps back, speed and duration depending on how much power you've accumulated during the previous high cycle, if you keep it low indefinitely then it will oscillate around 0 going both negative and positive until the signal dissipates, unless you've set it high again, which then restarts the feeding. Zero crossing is really measuring a delayed signal response with some level of built in error, while detecting the intent, ie detecting when the feeding started and stopped when the signal originally was created, should give less error.

Posted By

Waz
on 2024-12-13
07:40:57
 Re: "Streched out" tapes

Just out of interest @Crown - which tapes were you looking at attempting to convert? Might be interesting to see if the loader routines are known halfwaves or if there is some strange behaviour not as yet detected.

It's also why standard audio capture solutions as they are doesn't work (with the behaviour of the signal as you well described) and a proper hardware solution is the definite way forward. I can heartily recommend DC2N and have used that with a 1530 C64 deck and a 1531 Plus/4 deck (with Commodore's official 1531 to 1530 adapter) - and properly does those halfwaves every time.

Posted By

gerliczer
on 2024-12-13
08:28:18
 Re: "Streched out" tapes

Wow! Talk about a stupid misnomer. An idiotic terminus technicus that doesn't come even a bit close to the thing it tries to describe. So "halfwave" means PWM. And its counterpart, whatever those geniuses may have come up with, is square wave FM. (facepalm) My concept of "halfwave" was a half of a full wave, which is, AFAIK, an unbalanced signal in audio engineering. Today I managed to learn two things.

Posted By

Crown
on 2024-12-13
09:02:50
 Re: "Streched out" tapes

Essentially all my tapes, starting with the ones missing here. Doesn't really matter at this point which one, as everything starts with a Kernel Standard loader.

Here is what I have:
TapeXUM
Tiny C2N Monitor
D2CN4 LC
1530USB
1530->1531 Converter
10+ 1531 Decks.

I prefer TapeXUM, because it can capture at a 16Mhz sample rate. It's installer properly solves the Windows driver signing and installation issue, others might have. (It uses a really good approach for that, but that's beside the point) It uses OpenCBM and captures into CAP format, but the CAP -> TAP conversion is very vanilla, is not prepared to handle the complex issues we might want to have solved.

Tiny C2N Monitor is sort of the first line of indication whether a tape will be successful or not, it essentially shows the spectral view of the tape. It only knows the C64 wave sizes, but that's enough. You can see if the Analog->Digital conversion is noisy, or if the tape has stretching issues.

I haven't used the D2CN yet, it's highest capture rate is smaller then TapeXUM, I know its software does handle some of the stretching issues, but it can't import from CAP, has its own capture format (I might have to write a converter) and it is primarily C64 focused, it knows the various C64 loaders, I 'm not sure how much C16 specific support there is.

1530USB was probably a worthless purchase, its input is the digital signal coming from the 1531, but it exports it as an audio source on the PC, pointless conversion, and as it seems its software has no proper support for C16.

What I'd like to have, but not yet exists, is a 1531 modified with a TapeXUM, so that it can capture the analogue signal from the READ head, and capture the 1531 processed digital signal as well, at the same time at 16Mhz. This would be the ideal ultimate source.

I've started looking at the WAV capture and converting as a temporary solution as my 1531-es are in variously degraded conditions, and slowly but surely dying. I don't prefer the low capture frequency, but looking at samples at 44khz, it seems that there is enough data to work with. I can go at higher capture rate if needed. TAP base frequency is 880khz-ish. 92khz or 192khz might be enough if I can combine it with a software solution which normalizes the converted pulse lenghts into the ideal perfect values. (Needs code, solutions exists only for C64 formats)

One other strange thing I recently noticed the other day, I was audio capturing 3 separate tapes. I capture in stereo. One of the tapes had signal on the left channel, the other had signal on the right channel, and the third had signal on both channels, one at double volume tough. One more step in the process to handle.

So really there is two parts to the whole archiving process, first is obviously the capture and convert into digital signal, and the second would be to analyse, error correct and normalise the digital signal. This second part is very lacking in support currently.

Posted By

Waz
on 2024-12-13
09:31:02
 Re: "Streched out" tapes

I have the same DC2N model (D2CN4-LC).

There's a program that comes with it that converts the captured DMP file it creates to a TAP image (you can simply right click the DMP file and select Convert), so you don't need to write your own converter whatsoever.

As I said, it has proper C16 and Plus/4 support, includng the halfwave format (I've done quite a few transfers with it that are Halfwaves such as Thrust, all worked perfectly with no issues). You can specify the C16 TAP format for the capture too when setting up your capture. I've used both 1530 and 1531 (via the proper converter) with it, and everything works.

Client version 4.4.2 is very nice and stable for it too: https://www.luigidifraia.com/software/#DC2N4-LC_Clients

I am using the Windows GUI, which has that converter in.

Posted By

Volker_D
on 2024-12-13
13:28:00
 Re: "Streched out" tapes

Thank you both for that good answers! I will try.

Posted By

Gaia
on 2024-12-13
17:40:40
 Re: "Streched out" tapes

yapeSDL has a rather basic WAV loading mechanism, it was not meant to be sophisticated at all, it basically assumes that any WAV fed to it had already been preprocessed one way or another. YAPE is slightly better as it implements not just hysteresis but edge detection, too, and you can tweak some basic detection settings (invert signal, threshold). Actually, none of them is a true simulation of the signal detection as you rightly pointed out (although it would indeed have its benefits) but rather just good enough mechanisms to cope with good quality WAV files in a simple manner. I aimed to expand a bit the signal detection in a separate tool (MTAP2WAV) but it's kinda unfinished currently (many magic constants to begin with):
https://github.com/calmopyrin/mtapwav/blob/main/wav2tap.c
One good way of conversion would be to exploit what we know about the KERNAL header timings and calibrate the constants based on the difference of the actual signals vs the specs and dynamically adapt the detection algorithm. Well, the only question is whether it's worth it? Do we still have undumped tapes that are extremely rare and valuable but are severely damaged recordings? Probably not happy BTW, I used FinalTAP (?) back in the day to recover a rather shitty quality original turbo recording of MyChess 2.0... it was almost beyond hopeless but that was the only thing that worked - it uses an algorithm similar to what I mentioned above. The only problem was that the MTAP generated was C64 only, so I had to implement support for the C64 MTAP timings in YAPE.

Posted By

Crown
on 2024-12-14
06:21:59
 Re: "Streched out" tapes

Thanks, for confirming my suspicion. I guess in an emulator "good enough" approach is sufficient, but not in a converter.

I still have tapes which I are not yet available. Here is one example of an ultra-rare tape, we don't have in any format yet, not even in prg.


This is the spectral view of the Kernel sync and the Kernel tape header part, there is clear signs of stretching, some noise, and halfwaves should be closer and tighter, but I think it still has enough information that it could be reconstructed, but the advanced conversion methods used in the tools like FinalTap and D2CN only work on C64 tapes, and they are closed source. Heck we don't even have a visualizer where one can look at the actual digital signal. Just by looking at it, could give ideas on what type of error we deal with and how to remedy it.

So I clearly see a need for a better WAV->digital tool, and a FinalTAP like more advanced digital to logical conversion/cleaner tool for C16 tapes. But this might be my need only, so eventually I'll have to do it.

Posted By

Luca
on 2024-12-14
06:38:03
 Re: "Streched out" tapes

@Crown (and the rare tape is W...?).

Posted By

Volker_D
on 2024-12-14
18:32:53
 Re: "Streched out" tapes

@Crown: Do you have something like this:
https://www.ebay.de/itm/116396928370

Not sure if it works, but before I buy all that stuff that you have and before I try to learn all the stuff you know, I would buy you such an item (Or sent you only the money with PayPal, so you can buy yourself) and you might try to convert my WAV files?

Posted By

Crown
on 2024-12-15
03:11:34
 Re: "Streched out" tapes

The Ebay listing you refer to is to connect a Discman to your car cassette player, not really relevant here, it only helps you if you have a car from last century which only had a tape player, but you want to listen to CDs while driving.

I see a few use for it tough, connect it to the line out/line in of a PC soundcard, and put the tape in the 1531. Then you can really do 3 things with it. Simulate writing a tape and record it directly to wav, simulation can be feed both by a prg from a real C16 or, from a TapeXUM device, this would just shorten the time required for measuring how the Digital to Analog conversion works in the 1531.

You can do the opposite direction, feed a measurement signal from the PC, and run like an azimuth or headjust prg on the C16, but you would only adjust to head to this particular device. Also you can do measurements of the Analouge to Digital conversion this way, by feeding sample waves from the PC, and checking how the conversion result.

Posted By

MMS
on 2024-12-15
12:52:33
 Re: "Streched out" tapes

Nope they are not streched, the sound became dull over the years.

I bought last year a decent Yamaha hifi tower with proper speakers (it was a childhood dream: our parents never had the money for such a luxurious device)

I did not throw away my old cassettes. My experience with the normal ferrit tapes.: over the years (maybe 30) the upper frequencies diappeared, made the sound dull and silent. With the C16 tapes I recorded i had the same experience. As the recorded Commodore sound had a lot of higher frequency part, I suppose a lot a lot of information lost, so they could not be recovered.

Contraty to that, almost all chrome dioxide tapes I have, the sound remained almost intact and enjoyabe. Sony UX and UX-S, Maxell UL-II just to name few.

Unfortunately for the Commodores most of us used the cheap, or cheapest tapes, means ferrit tapes, so their contemt is not granted to be recovered after 30 years

Posted By

Volker_D
on 2024-12-15
08:38:32
 Re: "Streched out" tapes

hmm....
I just read this:
https://en.wikipedia.org/wiki/Commodore_Datasette

If i understood correct, then the "normal" frequency of audio doesn't matter at all.
If i understand that correct, then you can even record much too loud, for example with 500% amplitude and it should still work.
So if I understood correct, then the "only" problem in detecting should be the timing and the normal noise of an empty tape. The normal noise of an empty tape should of course not trigger a zero-crossing.

Posted By

Volker_D
on 2024-12-15
12:05:56
 Re: "Streched out" tapes

reading wav2tap.c

about case 2 and case 3 (case 2: // edge detect only and case 3: // sign change detect)
aren't there two times missing "else *bit ^= 0;" after line 95 and line 100?

Posted By

MMS
on 2024-12-15
12:49:34
 Re: "Streched out" tapes

@Volker_D
Not only the higher frequencies disappeared, the complete record sounded "dull". So I suppose the difference/contrast between the tape background noise and the real signal decreased, harder to detect the signal steps.

Dolby B or C could reduce the background noise, but I do not know how much the data signal would be detoriated, and how you could digitize those signals.

"Stretched tape": I am aware of one media it was realy valid, it was the ZX Spectrum Microdrive's first generation. the problem came from the very high speed of the tape, the thin media and the quick speedups and stopping. After a while the tape really scratched, "exended it's capacity") . In case of Commodore datasettes the speed was low (we know...), although the 'control was more manual via the buttons. (when Samsung bougth the microdrive business from Sinclair, they modified the microcontroller, the high acceleration and quick stappages removed, so the problem was solved)

But as Bil Herd told at an interview, they (Commodore) treated these computers as consumer electronics products, noone imagined at Commodore, that anyone will use them after 10 years, not to mention the 30 or 40 years. Now we try to recover magnetic tape records that are >30 years old. ( Not even NASA could manage to safeguard the moon landing analog records with their professional equipments and warehouses happy )

Posted By

Volker_D
on 2024-12-15
14:41:28
 Re: "Streched out" tapes

Viewing the WAV file in audacity, it is easy to "see" the difference between singles and background. (At least in my WAV files). ISo far I viewed "normal" tapes only. I didn't checked turbo tapes yet. I must read and check that also.
I counted the length of the signals in my WAV files. They are a bit different on my tapes then on WAV files that I created with tap2WAV. I think manual viewing it is easy. Writing an algorithm for that is of course more difficult. hmmm.... let me think a bit. I know how to code and have nice ideas (but sadly not much time).



Back to topReply to this topic


Copyright © Plus/4 World Team, 2001-2024. Support Plus/4 World on Patreon