AY tunes on a ZX81?

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
Sponsored By:

RWAP Software - support for Sinclair QL, ZX Spectrum, Cambridge Z88 and more


Re: AY tunes on a ZX81?

Postby trellis on Fri May 16, 2008 12:02 am

10 RANDOMIZE USR 40000 (and that's so-called "init")
20 RANDOMIZE USR 40006 (and that's so-called "play")
30 PAUSE 1 (this is standard delay/tempo)
40 GOTO 20

This would work, but would be too slow. The music would play at half speed, or less.
SpecAY basically does exactly this but in machine code, using HALT in place of "pause 1".
trellis
 
Posts: 1
Joined: Thu May 15, 2008 6:22 pm

Re: AY tunes on a ZX81?

Postby yerzmyey on Fri May 16, 2008 8:43 am

trellis wrote:
10 RANDOMIZE USR 40000 (and that's so-called "init")
20 RANDOMIZE USR 40006 (and that's so-called "play")
30 PAUSE 1 (this is standard delay/tempo)
40 GOTO 20

This would work, but would be too slow. The music would play at half speed, or less.
SpecAY basically does exactly this but in machine code, using HALT in place of "pause 1".


I see.
Oh, of course I put it only as an example of using these songs without requirement of interrupts.
If anyone code only in basic, he can try to remove PAUSE at all - and then test the result. If it's still too slow,
one must probably code it in assembler. Or maybe simply some coder could include whole this procedure into song
and play it automatically after
RANDOMIZE USR 40000 (for example 40000 of coz)
just like we play Z80 musix (Beeper) on Spectrum, where player-procedure is included and we start music-playing with
RANDOMIZE USR ......... only.

Then one can add such compiled music WITH player - into any ZX81 prog, even written in basic. :)

ZX81 is different computer so surely you are right that different methods can be used to obtain better results.

PS: Finally, if it would appear that all songs work too slow, which I consider as possibility, I wouldn't worry too much. If the project goes to reality, it's not for "re-playing" music from other computers, like from Spectrum.
It is ment - I assume - to add new music written specially for ZX81, to its games and maybe demos (although the music is written on Spectrum computer).
In this case, if anybody would ask me for some music, I would write some damn-fast-music ;) and after converting it into ZX81 it would work slower, means: better. :) :) :) :)
"FERENGI" - an arcade game for ZX81: http://hooyprogram.republika.pl/ferengi_zx81.rar
"MONOCHROME" - a NEW free paper/PDF magazine about ZX81: http://tiny.pl/8mmh
ZX-81/TS1000/TS1500 COMPETITIONS 2007/2009: http://zx81.republika.pl/
User avatar
yerzmyey
 
Posts: 342
Joined: Thu May 15, 2008 9:11 am
Location: Rubber Planet

Re: AY tunes on a ZX81?

Postby yerzmyey on Fri May 16, 2008 11:27 am

Finally I fond info about the AY-interface for ZX-81.

It was called

ZON-X Soundbox

(Text from Spectrum advert but it IS for ZX81) -
"Make amazing sounds with your Spectrum." 8 octaves, 3 channels with full control over pitch, volume, tones and noise, all with envelope control. Usable in your own Basic or M/C programs. Because this devices used the A4 address space, it is not compatable with the Interface 1 and Micrdrive. Because this was originaly a ZX81 interface, a small additional board is required. It sits between the ZON X and the Speccy, and conatins a 3.5Mhz oscillator to stabalise the frequency. "

More infos here http://www.worldofspectrum.org/infoseek ... id=1000467
including scans or articles from ZX Computing, Sinclair User, Computing Today.

I hope it helps.
"FERENGI" - an arcade game for ZX81: http://hooyprogram.republika.pl/ferengi_zx81.rar
"MONOCHROME" - a NEW free paper/PDF magazine about ZX81: http://tiny.pl/8mmh
ZX-81/TS1000/TS1500 COMPETITIONS 2007/2009: http://zx81.republika.pl/
User avatar
yerzmyey
 
Posts: 342
Joined: Thu May 15, 2008 9:11 am
Location: Rubber Planet

Re: AY tunes on a ZX81?

Postby yerzmyey on Fri May 16, 2008 1:31 pm

gasman wrote:Hello, I've been summoned here by Bruno too :-)

Yep, the .AY format isn't really one that can be transformed into something else at the AY data level - it's more like a Spectrum snapshot format. (Which is not a bad thing in itself, but the .AY format is dreadful for other reasons too.) You'd be better off using the 'tracker' file formats as your starting point - STC, SQT, PT3 (and a few other rarely-used ones), as introduced by AY_Emul. Each of these is a raw binary dump of the music data (not the code) for a particular Spectrum tracker, so each one is a well-defined format for which Z80 player code is readily available. I'll boldly guess that porting those three routines (Soundtracker, SQ Tracker, Protracker 3) will cover 80-90% of all AY music written for the Spectrum...

<skip>

About tweaking AY data to correct for the frequency - I agree with Yerz, it's not worth it. Firstly, the ZON-X and Fuller are only 8% off from the 128's frequency, which in musical terms equates to about one semitone; only people with perfect pitch will be able to tell the difference, unless you have the two playing side by side. Secondly, a lot of AY tunes won't survive the transformation, because of the way they abuse the AY's envelope generator to generate triangular waves: for this to work, the musician has to match up the envelope pitches by ear, and if you adjust the tone table, there's no guarantee that you'll be able to readjust the envelopes to sound like the original again, let alone be able do it automatically. Having said that, if you were really intent on supporting the Quicksilva interface you *might* get acceptable results by halving all the timing values you send to the AY chip. No promises though!


Gas, I've been told in another thread that there is an emulator that supports emulation of AY interface on ZX81.
It's here http://www.chuntey.com/ and it might be useful for tests. I think. ;P
"FERENGI" - an arcade game for ZX81: http://hooyprogram.republika.pl/ferengi_zx81.rar
"MONOCHROME" - a NEW free paper/PDF magazine about ZX81: http://tiny.pl/8mmh
ZX-81/TS1000/TS1500 COMPETITIONS 2007/2009: http://zx81.republika.pl/
User avatar
yerzmyey
 
Posts: 342
Joined: Thu May 15, 2008 9:11 am
Location: Rubber Planet

Re: AY tunes on a ZX81?

Postby BrunoFlorindo on Mon May 19, 2008 3:12 am

Sorry for the late reply. Had to work this weekend. :(

@yerzmyey: Welcome to the forum. I'm a great fan of your music, btw. Please ask your friend to share the schematics of the AY-3-8912 interface with us. I have many questions about AY and will probably contact you soon. :)

The emulator you mentioned to Gas is quite popular, and the author, Mike W, is the one who provided the ports and frequencies for all the AY interfaces for the ZX81 on the first page of this thread. :)

/on-topic:
I received a reply from Tim Fardell, creator of SpecAY, who said it would be very interesting to see this done. I invited him to join this forum. :)

@Gasman (Thanks for coming by!) & Mike: I keep forgetting the problem with .AY files, the unbeat-an-egg problem. Oh well, it would be a shame if we had to find tracker versions of tunes to be able to compile them to play on a ZX81. The reason I thought of the .AY files it's because there's a huge library readily available, something that could be used to show a ZX81 in action via an emulator, or a real ZX81 using any of the AY interfaces available for it. But if this isn't possible, let's explore the other possibilities. Let's not let this idea die. What about the utility on WOS that captures AY tunes from games and saves it as .AY. Could it be dissassembled and changed to be able to capture tunes from games and demos, and export them to something that the ZX81 can use? If this is too complicated, what about a Pro-Tracker-style program with options to choose which AY interface will be used (ZX 81 AY interface QSilva, etc, etc, Spectrum 128K, etc)? This would give ZX81 users the same power Spectrum users already have.

Gasman wrote:Recently (last week in fact) I wrote a utility for converting these formats to .TAP, .TZX and .AY, called tracker2ay - basically all it does is bundle the music file with the appropriate Z80 player, inside the requested container format. I'd be happy to add ZX81 support if there's interest (and people are willing to feed me the ZX81-specific details, specifically what address to put it at and how to write a Basic loader for it) - it would just be a case of hacking the Spectrum player routines to output to the right ports (dead easy for STC, probably easy for the others although I haven't looked at them closely enough to be sure) and implementing another container format (I recall that writing .P files was totally straightforward when I wrote ZXpaintyONE, so no problem there.)


As expected, I'm the first one to say 'Yes! Please do!!', and Mike would be the only person who (I think) would have the answers that you need.

I think that if we see the ZX81 pushed to the limit, it will help wake up Specchums too!! :mrgreen:

'Wow. If the ZX81 can do that, we have to do better Spectrum demos!!!' :lol:

edit:

Gasman wrote:...the ZON-X and Fuller are only 8% off from the 128's frequency, which in musical terms equates to about one semitone


Wait! Does that mean that SpecAY's assembler routine could be used right now to play AY tunes on a ZX81 with one of those interfaces? Or do we have to change the program a little bit?
User avatar
BrunoFlorindo
 
Posts: 193
Joined: Sat May 10, 2008 1:46 am
Location: Santa Ana, CA, USA

Re: AY tunes on a ZX81?

Postby BrunoFlorindo on Mon May 19, 2008 4:34 am

XavSnap wrote:http://zx81.ordi5.free.fr/vtr/


Looks really nice, but it looks like something developed by you, correct? It would be nice to know more about that interface (more information in English), especially because of the word "MIDI" that you mention on that page, but... would your interface be able to play AY tunes without conversion? How does it compare to the other AY interfaces Mike's EighyOne already emulates? It's nice to have something that can work on real hardware, but for the vast majority we need something that can work under emulation too. I don't think EightyOne supports that interface (for now).
User avatar
BrunoFlorindo
 
Posts: 193
Joined: Sat May 10, 2008 1:46 am
Location: Santa Ana, CA, USA

Re: AY tunes on a ZX81?

Postby gasman on Wed May 21, 2008 12:36 am

BrunoFlorindo wrote:I keep forgetting the problem with .AY files, the unbeat-an-egg problem. Oh well, it would be a shame if we had to find tracker versions of tunes to be able to compile them to play on a ZX81.


Well, it's not exactly a problem with .AY files - it's more an unsolvable problem that the .AY format doesn't attempt to solve. Any player routine written on the Spectrum (whether that's Tim Follin's player, Ben Daglish's player, the Soundtracker player or the Protracker 3 player) WILL need someone to look over the code by hand to convert it for the ZX81; to automate that job, you'd need a program which could make logical deductions about Z80 code. (In fact, this might not be completely impossible... just lately I've been experimenting with Z80 code tracing on an unrelated project, but on a much, much simpler level.) On the plus side, you only have to convert the player once to be able to play all the songs written for that player; clearly, there's more value in converting the Soundtracker/SQ Tracker/ProTracker players (which have thousands of songs), rather than (say) the Tim Follin one (which has half a dozen)...

What about the utility on WOS that captures AY tunes from games and saves it as .AY.

If you're talking about AYMake / AYMakeR, they're far from automatic. In fact, the Z80 hacking effort required to use them successfully is much greater than the effort required to convert an already-captured AY file to ZX81.

Wait! Does that mean that SpecAY's assembler routine could be used right now to play AY tunes on a ZX81 with one of those interfaces?

Nope... the thing to realise is that SpecAY itself does not contain any music-playing code - that's all embedded in the .AY file. SpecAY's task is to unpack the contents of the .AY file into the right place in memory (which is an achievement in itself, because the .AY format is so horrible :-) ) and then pass control to the unpacked routine.
gasman
 
Posts: 2
Joined: Thu May 15, 2008 9:57 am

Re: AY tunes on a ZX81?

Postby yerzmyey on Wed May 21, 2008 8:28 am

...and another thing is making music for new progs.
Avarage man isn't able to make *.AY file, much simplier is to make a TAP.

And if the interrupts are so hard on ZX81 then maybe first - for tests (but not only) - it would be better to make some convertor that would convert compiled (ST? PT?) song from TAP into *.P, adding proper routine started by some USR, CALL, or whatever is on the ZX81 (as I recall, it's still RANDOMIZE USR).

For a beginning it would provide start-songs for games (like on Spectrum and Beeper).

I mean - one step at the time. If anybody is brave enough to try later making a player with interrupts, to make in-game-musix - the better. ;)

But I really suggest to stay with TAP/STC/PT3 format at the moment.
I think this collection is huge enough ftp://ftp.untergrund.net/users/bulba/Tr_Songs.7z
For the start anyway. ;) ;) ;) ;) ;) ;) ;) ;) ;) ;) ;)
"FERENGI" - an arcade game for ZX81: http://hooyprogram.republika.pl/ferengi_zx81.rar
"MONOCHROME" - a NEW free paper/PDF magazine about ZX81: http://tiny.pl/8mmh
ZX-81/TS1000/TS1500 COMPETITIONS 2007/2009: http://zx81.republika.pl/
User avatar
yerzmyey
 
Posts: 342
Joined: Thu May 15, 2008 9:11 am
Location: Rubber Planet

Re: AY tunes on a ZX81?

Postby yerzmyey on Wed Jun 18, 2008 10:53 am

I lost my scheme and I don't know why/where/when.

But this is another scheme of AY-interface for ZX Spectrum:

http://zxm.speccy.cz/dok/sch/melodik.jpg

Anybody could try to change it in this way that it would work on ZX81?
I think it's worth to try.
"FERENGI" - an arcade game for ZX81: http://hooyprogram.republika.pl/ferengi_zx81.rar
"MONOCHROME" - a NEW free paper/PDF magazine about ZX81: http://tiny.pl/8mmh
ZX-81/TS1000/TS1500 COMPETITIONS 2007/2009: http://zx81.republika.pl/
User avatar
yerzmyey
 
Posts: 342
Joined: Thu May 15, 2008 9:11 am
Location: Rubber Planet

Re: AY tunes on a ZX81?

Postby Moggy on Thu Jun 19, 2008 8:42 pm

Hi everyone
Just a newby hello to you all from a fellow "black plastic door wedge " lover.
great site ,(love the techy bits) More of an original hardware user but the emulators really knock me out. Anyway as a zon x-81 owner who cannot coax anything more than a strangled squeak out of the damm thing i wish you all the luck in the world with this subject.
heres a site that may be of interest to you.


Regards Moggy

http://bulba.untergrund.net/main_e.htm
Moggy
 
Posts: 75
Joined: Wed Jun 18, 2008 1:00 pm

PreviousNext

Return to Development

Who is online

Users browsing this forum: No registered users and 0 guests

cron