ZX81 audio.

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

ZX81 audio.

Post 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.
Attachments
carolina .zip
(1.23 MiB) Downloaded 57 times
Last edited by Moggy on Tue Feb 28, 2023 2:30 pm, edited 1 time in total.
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: ZX81 audio.

Post by mrtinb »

I assume this is FAST mode without screen.
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: ZX81 audio.

Post 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?
User avatar
marste
Posts: 250
Joined: Sun Aug 10, 2014 9:58 pm
Location: Italy
Contact:

Re: ZX81 audio.

Post 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? :)
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: ZX81 audio.

Post by Moggy »

@ marste.

PM.
User avatar
marste
Posts: 250
Joined: Sun Aug 10, 2014 9:58 pm
Location: Italy
Contact:

Re: ZX81 audio.

Post 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 :)
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: ZX81 audio.

Post 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:
User avatar
1024MAK
Posts: 5101
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: ZX81 audio.

Post 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
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
User avatar
marste
Posts: 250
Joined: Sun Aug 10, 2014 9:58 pm
Location: Italy
Contact:

Re: ZX81 audio.

Post 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
Last edited by marste on Tue Feb 14, 2023 12:30 am, edited 1 time in total.
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: ZX81 audio.

Post 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.
Last edited by Moggy on Mon Feb 13, 2023 9:14 pm, edited 3 times in total.
Post Reply