streaming music

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
Post Reply
nollkolltroll
Posts: 325
Joined: Sat Sep 27, 2014 8:02 pm
Location: Stockholm, Sweden

streaming music

Post by nollkolltroll »

I've coded a quick proof-of-concept that takes data from a file on the zxpand and dumps it to the registers of the sound chip. This way it is possible to play any music without coding a specific player, just dump the register values to a properly formatted file and go. Also, the files are waaay bigger than the ZX81 RAM.
Just another way to use/abuse the zxpand :D

If there is interest I'll upload the files.
/Adam
sirmorris
Posts: 2811
Joined: Thu May 08, 2008 5:45 pm

Re: streaming music

Post by sirmorris »

Yes please!

Moggy! Moggy! Dark side of the moon coming up!

hehehe
Moggy
Posts: 3267
Joined: Wed Jun 18, 2008 2:00 pm

Re: streaming music

Post by Moggy »

sirmorris wrote: Fri Apr 21, 2017 1:41 pm Yes please!

Moggy! Moggy! Dark side of the moon coming up!

hehehe
Well if you'd stop faffing around with that bloody MIDI player and wrote the SD card streaming software you promised a while back then I would be listening to the sodding solo from "Time" through my Xpands WAV player right now!!


Realising everything he'd written about Charlie's lack of team spirit was complete tosh , Moggy retires drunkenly to his favourite chair. :oops:

@nollkolltroll .

This sounds amazing PLEASE POST NOWWWWW!! :lol: :ugeek:

But only in a form usable by a useless non Tecchy like me who only understands plug and play. :( :lol:
nollkolltroll
Posts: 325
Joined: Sat Sep 27, 2014 8:02 pm
Location: Stockholm, Sweden

Re: streaming music

Post by nollkolltroll »

Here is the software, which was a quick and fun weekend hack at SlaskHack 2017.
NOTE: it is only a proof-of-concept, ROUGH EDGES ABOUND! :oops:

Place the 2 psg-files and the p-file on the zxpand sd-card, run the p-file directly.
The player is mixed basic and assembler, written in zx-ide. Delays are minimized, which works fine for me, but certainly might make things crap out. The playing file is printed on screen, press any key to advance to next song. Running the program again will fail, you need to load and run every time :? .

The python3-script to convert from ym6-file to psg is included, also very rough. It starts with a 2-byte header with number of VBLs and follows with that number of 16-byte psg-register values. The ym6-files dumps every register by themselves, the converter combines the register values per VBL instead.

I hope this works for most of you, and possibly let someone get some good ideas from it.
I had thought about doing this as a plugin for zxcommander, but time ran out.

Download:
psgplay.zip
(35.84 KiB) Downloaded 143 times
/Adam
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: streaming music

Post by Andy Rea »

Just saw this, looks very interesting, hopefully I'll get chance to.have a play sometime.

Andy
what's that Smell.... smells like fresh flux and solder fumes...
Moggy
Posts: 3267
Joined: Wed Jun 18, 2008 2:00 pm

Re: streaming music

Post by Moggy »

It's streaming from the card 200k !!!

This "Streaming" technique could any file be streamed by the same method?
I have a WAV player courtesy of Sacha2000 but it is limited by sample size (21k).
This could be what I'm looking for except I'm not clever enough to understand the nuts and bolts of it. :oops:
nollkolltroll
Posts: 325
Joined: Sat Sep 27, 2014 8:02 pm
Location: Stockholm, Sweden

Re: streaming music

Post by nollkolltroll »

Moggy: yes, any type of data can be streamed like this. But wav-files are tricky because the reading of data can be done in bursts, where the time between every 256 bytes is quite long. The code would get quite hairy, trying to do both burst reads and steady outputs of sound data at a high enough frequency. Someone made an MSX wav-player that used viterbi-coding to get good 8-bit quality from the soundchip: https://www.msx.org/forum/development/m ... s-poor-psg
/Adam
Moggy
Posts: 3267
Joined: Wed Jun 18, 2008 2:00 pm

Re: streaming music

Post by Moggy »

Thanks nollkolltroll, I sure wish I had the brains for this!! :oops:
Post Reply