Page 1 of 4

ZX81 audio.

Posted: Sat Feb 04, 2023 3:26 pm
by Moggy
For anyone interested, this is the current quality of ZX81 audio when used in conjunction with the spand (classic or + versions), half a handful of resistors and some very clever software from Adam Klotblixt.

Sounds good through decent speakers/phones, laptop squeakers not so much! :lol:

To play, use Audacity. inport as RAW data, the info box that Audacity throws up shows the properties of the file which should read as

Unsigned 8 bit PCM

Little endian

1 channel mono

0 byte offset

100% import

Change the sample rate to 22109 then press the import button, play and enjoy.

Re: ZX81 audio.

Posted: Sat Feb 04, 2023 5:58 pm
by mrtinb
I assume this is FAST mode without screen.

Re: ZX81 audio.

Posted: Sat Feb 04, 2023 7:08 pm
by Moggy
No slow mode. the title of the song is first shown but when the player starts the screen just shows a pattern of horizontal lines as I believe Adam has used the horizontal sync as some kind of counter/timer.

Excellent achievement though I would have thought?

Re: ZX81 audio.

Posted: Fri Feb 10, 2023 9:58 pm
by marste
With this quality one can think to write a mod tracker player to run on bare old hardware!
Just sample size might be a bit limited but 16K or 32K might suffice for very nice songs!!
Where to find the schema for the "couple of resistor" assembly? :)

Re: ZX81 audio.

Posted: Fri Feb 10, 2023 11:02 pm
by Moggy
@ marste.

PM.

Re: ZX81 audio.

Posted: Sun Feb 12, 2023 6:47 pm
by marste
Without the full *pand interfaces I suspect that a single 74273 or 74377 might be used to drive the resistor DAC network.

For the HW experts, something like the following picture can work?
photo1676223675.jpeg
Notes:
- the picture is just to give an idea of the realization, and should be revised and optimized (e.g. "not gate" with diode logic) by people better knowing electronics and the ZX81 bus I/O!
- BAx is one of the address lines that can be used to identify the port (other signals can be used if useful, e.g. avoiding at all the "not gate" mentioned before)

This just to give a very low cost alternative for audio out :)

Re: ZX81 audio.

Posted: Sun Feb 12, 2023 10:28 pm
by Moggy
Interesting in theory I suppose but then you have to create some kind of "clock" to time it, some way to stream the audio and find some method of connecting it to the zeddy as well as creating some software to run it and then there is the problem of sample size after the software has filled most of the memory, and after buying the parts required not such a cheap method I would think.

Also any sample that is measured in kilo-bytes will sound dreadful unless you are aiming for the AY type buzz and clicks found with most tracker software.

The idea of using it with the spand was that most people now have at least one, it conveniently has the 8-bit B port tracks/pads on the board for easy connection, the software is written for it and will stream any size audio file created for it from an SD card whilst keeping a decent quality of sound.

Another consideration was that it had to be able to be done by a thick bugger such as myself whereas what you advocate lies in the realms of planet genius for idiots like myself, not all of us are this tech savvy or hardware "experts". ;)

Soldering together a bunch of resistors is about my limit whereas your diagram and what it entails may as well be in Greek for a simpleton like me to understand let alone build. :lol:

Re: ZX81 audio.

Posted: Mon Feb 13, 2023 5:48 pm
by 1024MAK
marste wrote: Sun Feb 12, 2023 6:47 pm Without the full *pand interfaces I suspect that a single 74273 or 74377 might be used to drive the resistor DAC network.

For the HW experts, something like the following picture can work?
A practical design is here although this version is based on it being memory mapped rather than in I/O space.

Rather than using individual logic gates, using a 74xx138 and a 74xx377 is easier. Use either LS logic or HCT logic.

Three address lines go to pins 1, 2 and 3 on the ‘138. E.g. A5, A6 and A7.
/IORQ goes to pin 4 or 5 on the ‘138
/WR goes to pin 4 or 5 on the ‘138
Another address line, e.g. A0 goes to pin 6 on the ‘138 or just tie this pin to a logic high level.

Then pick which output pin (and hence I/O address) to feed to pin 11 (CP) of the ‘377.
Pin 1 on the ‘377 can be another address pin, or tied to 0V.

Mark

Re: ZX81 audio.

Posted: Mon Feb 13, 2023 8:07 pm
by marste
@Moggy

Circuit is very simple: there is an octal flip flop (74377) that drive the resistor DAC network. Two of them can output stereo sounds. The diodes are to enable the write on the flip flops on proper address, e.g. $BF (0b11011111) for the A5 address line (A0 and A1 are reserved for NMI and keyboard and tape, A2 for printer, but the others seems free to be used, or at least in the base ZX81 ROM I didn't find anything else used).

Cost of the two (for stereo) ICs together might be one euro; resistors and diodes might cost a bit more but still little. And important for me, this circuit would be in line with the time period and Clive orientation on "minimization" :)

Regarding software, everything will be streamed by the ZX81 itself with its own clock. About memory size, for the instruments I think that a 256 bytes waveform with ADSR might already give good results. For the music, trackers have already proven good 4 tracks music, and those are very compact also.

@MAK
Seems to me that we can save the 74138 using one entire address line (e.g. A5 and A6 if stereo) dedicated to the purpose and enable the write with that (as depicted in the hand written schema above). To save the not gate more than an address line, since data is ready after the addresses set, seems WR is a better solution for CLK. Even maybe directly without not gate if IORQ would be slowed down a bit by the (diode diode) OR gate (or with a tiny capacitor). The sequence should be:
1. A0-A7 are set to the correct output port
2. D0-D7 are set to the correct data to be written
3. IORQ is set to 0
4. WR is set to 0
5. WR is set to 1

Ad is depicted in the schema:
inout.png

Re: ZX81 audio.

Posted: Mon Feb 13, 2023 8:53 pm
by Moggy
Ah I think I understand what it is you actually want now.

A tracker of some description to play simple wave forms as opposed to the audio juke box what Adam has created to play actual songs/music/speech files etc.

I think the Spectrum has a version of this.

https://www.youtube.com/watch?v=feqdwdAn3K0

I not too sure about the stereo bit though as unless the two chips and the two DACs can share each others data/wave form then all you have is two mono signals which when plugged into a stereo amplifier rather than a mixing desk, will just be two mono signals panned hard left and right. For true stereo the signals need the ability to be mixed somehow and the only way I could imagine in this set up is something similar to what chip tuners do with their AY boards using resistors to achieve pseudo stereo.



I can't say I understand your circuit description as I don't have the brain for it but no doubt the gurus will. :D

While it is not something I'm personally interested in it would be nice for the zeddy to have something his big brother the spectrum has and look forward to seeing the finished result.