News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

Computer data recorded to Cassette Tape

Started by GeoffB17, 16:20, 28 October 17

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

GeoffB17

Rob,

Massive thanks for your efforts.

BUT..

I've tried to LOAD this, and no response.   Nothing.

I immed tried one of the files I'd previously saved, and this worked fine, loaded, prog runs.

Tried your file again, same command, nothing.

I tried LOAD "CAS1:Rob1" - if the name was wrong, the HX would usually report 'SKIPPING xxx' with the name of the prog it HAS found, which would prompt me as to the filename you've actually used and retry, but I don't even get that.

**** Interesting - I note someone else has downloaded the file.   Is there someone else with a HX20?

Geoff

robcfg

Well... I was sure it most probably wouldn't work on the first attempt  :)


I'm pretty sure that the file is correct as I can successfully decode it as with your previous examples.


Maybe the volume is too high or the frequencies aren't quite right.


Could you try lowering the volume on an audio editor to 40% and try again?


The frequencies are 1000 and 2000hz, but on your machine they are around 1000 and 1800hz, I'll try to generate a new wav with those parameters.


And maybe, it expects a sine wave and not a square wave...


I'll upload some new tests shortly!


robcfg

Here you have two tests: both at 50% volume, one with square waves and one with sine waves.


Please try them. Try also different volumes in case your output is too saturated and is distorting the waves.


If they don't work, I'll try adjusting the frequencies, but they should be fine.

robcfg

I realised that I was using the wrong file type for an ASCII basic file...  :picard:


Could you please try the attached file?

GeoffB17

Rob,

Thanks for new versions.   I've just downloaded them, I'll got to try them now.

I don't think it's anything to do with volume.   As I understand the data in the file, the levels are the same as normal, and I've not changed any settings on anything.

But I'll check that anyway.

However, the data in the file is NOT as before, but I don't know if this is important.   The data in Rob1 does NOT represent a wave, with (+) peaks and (-) peaks, in effect it has (-) peaks and (0) peaks>

The original data showed numbers that were + and others that were -.   There were no zeros within the data.   Zero represents a flat line in the middle of the wave, i.e. no signal.   Then the values 1 to 7F represent the level of the (+) wave rising above and back down to 0, while the values 80 to FF represent the (-) part of the wave.   Yet your file is either FF or 0.

I don't think the sine/square wave thing is relevant.   The wave form should be sine, but even the higher resolution .WAV showed no sign of any sine wave form, it has always been - in effect - as near square wave as makes no different.   I;m sure the computer is just detecting the frequency, and the form is irrelevant.

Geoff

GeoffB17

Rob,

Just unpacked files etc, heading for other computers.

Just looked at binary data in Rob4 - YES - this looks much more like what I _THINK_ it should be.   I guess you've already changed whatever was up with Rob1?

Geoff

GeoffB17

Rob,

No joy.

Tried Rob4, nothing.

Just to be on the safe side, please confirm EXACTLY the filename in the data header.   I think the LOAD process is fussy.   There is space for 8.3 filename, I think, but normal operation seems not to use the extension, but it may check it?   If just one file, may not show 'SKIP' message.   Also, process DOES differentiate between case, so Rob4 and ROB4 are different.   Also, please ensure any chars of name data not used are set to space?

BUT - as noted prev message, data in Rob4 looks much more likely.   Compared to Rob1.   Not tried anything with Rob 2 and Rob3.

Tried different volume settings with Rob4.   No visible difference.

Geoff

ThomH

Quote from: GeoffB17 on 13:42, 12 November 17I don't think the sine/square wave thing is relevant.   The wave form should be sine, but even the higher resolution .WAV showed no sign of any sine wave form, it has always been - in effect - as near square wave as makes no different.   I;m sure the computer is just detecting the frequency, and the form is irrelevant.
It almost certainly has a low-pass filter on its audio input train, and can't even tell the difference between sine and square. But most machines of the time count zero crossings — it has to be very clear that the wave was below zero and that it is now above zero. Just touching zero from either direction could be sufficient if the filter also eliminates DC bias, but you should definitely try very obviously to cross it.

GeoffB17

Well, the earlier Rob1 file was NOT crossing the zero (cente) LINE.   My original saved file was.   Rob's latest Rob4 file IS now showing values that cross the line, so this should be better.
BUT, my HX is not even recognising the file.   I'm just hoping to rule out any problem with the filename.   I had a .WAV from somewhere else, and that declined to load until I realised that the filename (in the file header)was a mix of case (i.e. Jump rather than JUMP) and then it loaded fine.   I think that the HX would always SAVE as capitals, although I never tried to save as a mix.   In any case, when the LOAD process recognises the file, there's a message saying LOADING Rob4 or whatever. I never get such a message. YET!!
Of course, getting that message will not be the end of the matter.   Might get that message, and then get another like IO ERROR, which I was getting from the microcassette drive due (I guess) to the rubber drive band having corroded.
Geoff

GeoffB17

So, crossings may be enough?   I'll keep that in mind.   I assume that this will be relative to time, so that x crossings in a given time unit will indicate one frequency, and 2x crossings in the same period will indicate twice the frequency?
Geoff

ThomH

Quote from: GeoffB17 on 18:00, 13 November 17
So, crossings may be enough?   I'll keep that in mind.   I assume that this will be relative to time, so that x crossings in a given time unit will indicate one frequency, and 2x crossings in the same period will indicate twice the frequency?
Geoff
Yes, that's generally sufficient for most micros. Some sort of counter counts the amount of time between one crossing and the next, and the value of that counter indicates the length of wave encountered. Some machines, like the Commodores, simplify that even further and count only the crossings in one direction — in that case from negative to positive if memory serves.

So the process can be as simple as:

while(loading) {
    counter = 0;
    while(no upward zero crossing) counter++;
    if(counter > threshold) post_bit(1); else post_bit(0);
}


... though if you want to get really robust then you should really use the solid tone at the start of recording to figure out what value 'threshold' should take, and possibly even constantly recalibrate it as you go, and perform a low-pass or band-pass filter before processing anything, but that's usually in-hardware on a real machine.

robcfg

#36
I'm checking everything I can, but I don't see any obvious mistake.


Here you have a new version with the file name in uppercase and reduced the frequency of the 0 waves from 2000hz to 1800hz.


I've check the header data against your files and everything seems in place.


By the way, all my wavs do have crossing waves, but they are saved as 'unsigned' values, so if you're checking them, they range from 0 to 255, being 128 the middle value.


Edit: I forgot to say that I changed the name of the program to ROB1 just in case.

GeoffB17

Thanks Rob.

Tried LOAD "CAS1:ROB1" but nothing.   Tried various volume settings, but volume not partic loud even at max.

Tried FILES"CAS1:" as well, which should do a sort of DIR, but this recognised nothing either.

Using ears to check playback, seemed OK, although seemed to be a lot less data than usual.   But then, I guess your prog is pretty small as well.  Please detail what SHOULD be there, I'll try to enter same thing, and create matching .WAV as created by HX, to compare.

Geoff

robcfg

That's a great idea!


The program is as follows:
10 PRINT"Hi Geoff!":END


I'm pretty sure it's something silly  :)

GeoffB17

Hello,

I've created the prog on my HX, and saved it as ASCII, as ROB1.

The default save process saves as 16 bit stereo, I've converted to 8 bit mono, but it's still twice the size of your file.

Oh, after I'd saved the 'reduced' version, I ran the LOAD process,and it loaded fine.

I'll check for differences later, but I guess you'r 'tools' can do more than mine.

Thanks.

Geoff

robcfg

Hi Geoff!


I've fixed the date format, the spaces between blocks and added a 0xD as first character of the basic listing as in your file.


Please try the attached wav file.

GeoffB17

Rob,

I saw your new file last night, but the battery on the HX had run down, and anything I tried to do was not reliable.

Tried again today.

Tried to load ROB7, took no notice.

TRied the FILES"CAS1:"  which may have indicated if I was getting file name wrong, but that revealed nothing,so still not happy.

Just now, my main PC is dead, getting sorted, so I cannot access my dev work.   There's a limit to what I can do on this W7 laptop.  At least, I can access email etc and the web, and this is the machine that records/replays the .WAV files.

Geoff

robcfg

Which program do you use for playing the wav files?


I had problems with several audio editors, and the one working for me is audacity.

GeoffB17

I'm just using Media Player.

Audacity seems heavy handed?

MP has worked fine for various different 'qualities', and levels.  The files I've saved work OK.

Geoff

GeoffB17

I'm still stuck with the W7 laptop, although this does have all the .WAV files on.

As mentioned before, I'm using the W7 SoundRecorder to do the recording, the plus of this is that it's quick & easy, and lo time limit.   But allows no manipulation of the saved file/data.

I also have on this machine the XP version of SoundRecorder, filename sndrec32.exe.   This will allow various options over and above the recording.   BUT, it will not record more than 60 secs.

It does however show an image of the recording, like Audacity, and allows some editing, and allows save in different 'quality' settings, etc.

If I use this prog to look at the file I made rob6t2, and your file rob6 (rob1), which should be the same thing, the appearance of the data is quite different. My file is totally 'blocky', i.e. more a square wave, even totally a square wave.   Your file shows much more like a sine wave.  As in a string of balloons of slightly different sizes.

It's unfair to say that one is right, and the other is wrong, because they may sound very similar.   But one clearly works, and the other does not.

Do you have the XP prog.   SNDREC32,EXE?

Geoff

robcfg

I suspect that programs treat the 'zero level' slightly different.


Please try to load my last file through audacity.

GeoffB17

Well, I'm not sure if this tells us anything.

I went into Audacity,and loaded your recent file ROB7.   A said it was 32 bit, should be just 8?   Anyway, I didn't change any setting in A (not that I know how).   I set HX to LOAD, set A to play.   Nothing.

Just to confirm, I then loaded my last file, ROB6T2.   Looked fairly similar on the A screen, actually.   Repeated process.  Loaded into HX fine.  At this end, no visible difference between MP and A, MP just a little easier.

So, seems to make no difference between A and MP.  Neither process seems to recognise your file.   Both processes seem quite happy with original SAVE file.

What next?

Geoff

GeoffB17

Maybe there are settings re time scale, but A shows just solid bar.   not correct definition to suggest any wave form.

SNDREC32is more helpful,in that you can see wave form, or lack of it,and gaps between bits?

Oh, just testing, but determined that SNDREC32 will NOT record a signal for more than 60 secs, however, it WILL load, and modify, and save an already created file (say created by the W7 prog).

Geoff

robcfg

Hi Geoff!


Could you try the new wav file?




GeoffB17

Hello Rob,

Just found your message from late last night.

Tried the file ROB8.

Sorry, but no change.   Neither LOAD or FILES indicated anything.

Loaded the file into SNDREC32, and in structure the file looks just like previous version, i.e. the waveform that looks line a string of round balloons.

I've got a working PC again, still getting things sorted on it, but I'll get vack to my prog that was doing some initial analysis, and have a look myself.

Thanks again for your efforts.

Geoff

Powered by SMFPacks Menu Editor Mod