Nandemo PiGa the binary <-> wav converter for tapes

Page 3/6
1 | 2 | | 4 | 5 | 6

By mcolom

Resident (57)

mcolom's picture

13-12-2019, 20:54

pgimeno wrote:

I've commented it on #openmsx in freenode, but let me repeat it here.

After my previous post, I looked at the source of wav2cas and realized a few things about it.

It's asymmetric, it treats raising and falling edges differently, which is probably why changing the phase helps sometimes.

Well, normally the MSX BIOS takes care of that.
Have a look at the TAPIN (for example) routine. http://www.msxvillage.fr/upload/bios.txt
It checks:
- High or low state
- Falling or raising edges
- The speed of the tape (computed from the width of the pulses in the header)
- Normal or reverse polarity

I'm looking at the GP.wav file mentioned in the openMSX GitHub issue (the other file no longer exists), and it's pretty weird. I'm analyzing it just because I find it really strange that a real MSX can read it! So mysterious...

By Manuel

Ascended (15979)

Manuel's picture

13-12-2019, 23:40

I wonder if a real MSX can indeed understand that wav file. It seems to be sampled pretty badly.

By mcolom

Resident (57)

mcolom's picture

14-12-2019, 00:34

Yep, I'm starting to lose any hope :/

By Manuel

Ascended (15979)

Manuel's picture

14-12-2019, 21:03

enribar: you said you sampled a few tapes and they wouldn't load in openMSX. Would the sampled tapes load in real MSX? If yes, I'd like to investigate them with our team.

By pgimeno

Resident (48)

pgimeno's picture

14-12-2019, 22:56

mcolom wrote:

Well, normally the MSX BIOS takes care of that.

Once the signal is turned into the single bit that the software can read, yes. I was talking about the algorithm that wav2cas uses for recognizing raising and falling edges in the "analog" signal. wav2cas doesn't use the BIOS.

By mcolom

Resident (57)

mcolom's picture

15-12-2019, 10:07

pgimeno wrote:

I was talking about the algorithm that wav2cas uses.

Yep, I misunderstood you. Indeed, it could be that the analog circuit that filters the signal doesn't behave the same with the raising and falling edges. If we find tapes (WAVes) that we are sure that load in a real MSX and not in the emulator, we could look at the computer's schematics, simulate the filter (say, in ngspice or similar), and try to implement a similar filter in the software.

By pgimeno

Resident (48)

pgimeno's picture

15-12-2019, 16:21

mcolom wrote:

BTW: I'd be useful to know which MSX model could load the WAVs, to look at their input circuit and reveal their hidden magic! Big smile

I was interested in this too. I found this page: https://hansotten.file-hunter.com/manuals-and-guides/ with the service manuals of several models. I checked the Philips VG-8020/00 and the Canon V20. They have the exact same circuit. Here's the Panasonic schematic, which has better image quality:

It's too complex for my poor understanding of electronics. I recognize a high pass filter (C6+R10+R11), with the resistors working as a voltage divisor, and a voltage halver (R13+R14), but I can't make much sense of the comparator configuration; however in the data sheet of the 311 there's a "COMPARATOR WITH HYSTERESIS" circuit which looks very much like this, so I guess that's it. I don't understand the role of R12 or C7 or C38, or why R10 connects to 2.5V instead of 0V.

I've also checked the SVI728, which has a very simple circuit with four resistors and one transistor, but the scan is of too poor quality for me to make sense of it, and the Sony HB-G900P which has another 311 but with a somewhat different circuit.

By mcolom

Resident (57)

mcolom's picture

15-12-2019, 17:00

Some time ago I analyzed the circuit of the Sony HB-101P/201P (http://www.msxarchive.nl/pub/msx/mirrors/hanso/service_manua...) which is similar and also with the 311 comparator. Let me see if I can figure out how this works...

By mcolom

Resident (57)

mcolom's picture

15-12-2019, 18:51

Assuming that the input is zero (it's small, anyway), we can consider i1 the current that goes through R12, i2 that current that goes through R14 and i3 the one that goes through R13.

Writing the system of equation in Sage (I'm too lazy to do the computation by hand), we have:
var('i1 i2 i3 Vp Vm')
eq1 = i1 == i2 + i3
eq2 = i1 == (5 - Vp)/480000
eq3 = i1 == (5 - Vm)/470000
eq4 = i2 == Vp/2200
eq5 = i3 == (Vp-5)/2700
solve([eq1,eq2,eq3,eq4, eq5], i1, i2, i3, Vp, Vm)
[[i1 == (9/1571960), i2 == (1609/1571960), i3 == (-40/39299), Vp == (88495/39299), Vm == (90745/39299)]]

So, V+ = 2.25, V- = 2.31.
The input signal from the cassette (S) is small and somehow added to V-. I'm just approximating, not giving number now.

I think the output of the comparator is simply checking if S is positive or negative.
C7 and C38 are used just to stabilize the voltage

I guess this is it, but I'm no expert...

By mcolom

Resident (57)

mcolom's picture

15-12-2019, 18:24

pgimeno wrote:

but I can't make much sense of the comparator configuration;

It's exactly the "open collector output" in page 3 of the datasheet: pins 4 and 1 to ground, 8 to Vcc, and 7 connected to 8 via R7 (RL in the datasheet).
So, it can connect to ground (when the cassette signal is negative) or it can disconnect the output (when the cassette signal is positive) and it gives Vo = Vcc = 5.

Page 3/6
1 | 2 | | 4 | 5 | 6