Elk Player

new graphics/music demos - bitshifters, 0xc0de, The Master + others
User avatar
Negative Charge
Posts: 93
Joined: Sat Jan 16, 2021 1:35 pm
Contact:

Re: Elk Player

Post by Negative Charge »

Arcadian wrote: Thu Mar 11, 2021 5:13 pm These are breathtaking - I downloaded them all yesterday and have been amazed by what I've heard so far. I wonder if any of the game soundtracks could be 'hacked' into the original Elk versions of the games?!

Anyway, I've just sent you a PM about tonight's Dev Night ... and have enabled your PMs too so you can actually reply! ;)
Thanks for your kind words. I think hacking these back into existing games is beyond the limits of my capabilities - maybe one for 0xC0DE :D

Unfortunately I can't make the Dev Night tonight, but thank you for the invite.
User avatar
0xC0DE
Posts: 1300
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: Elk Player

Post by 0xC0DE »

Negative Charge wrote: Thu Mar 11, 2021 5:43 pm Now sync'd the 100Hz interval timer - the note duration is a lot more consistent:

https://youtu.be/G7S3sLTcrRg

I have a 50Hz version of the track working against the DisplayEnd interrupt, but it loses some of its character due to the loss of a significant number of notes. Just need to incorporate this test back into the player and see how well it works with the other tracks. This temporarily breaks Model B compatibility, but it's working fine on the Elk and a Master.
It sounds wonderful! =D> =D>
0xC0DE
"I program my home computer / Beam myself into the future"
:arrow: Follow me on Twitter
:arrow: Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
User avatar
Negative Charge
Posts: 93
Joined: Sat Jan 16, 2021 1:35 pm
Contact:

Re: Elk Player

Post by Negative Charge »

One last experiment for today: https://youtu.be/wU91fGvycsw - A rendition of "There Aren't Any Sheep in Outer Mongolia" as heard on the BitShifter's Twisted Brain demo. This is pushing the approach a little too far, but an interesting experiment with the interval timer. It starts getting interesting around 2m 25s.
User avatar
Negative Charge
Posts: 93
Joined: Sat Jan 16, 2021 1:35 pm
Contact:

Re: Elk Player

Post by Negative Charge »

I've been working on version 2 of the player, utilising the 100Hz Interval Timer and 50Hz DisplayStart event to synchronise some basic visualisations. Here's a preview of where I'm going with this, using Martin Galway's Galaforce Title Music as the source material:

Image

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

I now have a script to automate 90% of the conversion process, and create the compressed player files with header information. Once I've got this all working I'll publish the source - my 6502 assembler still needs a lot of work.
chrissawer
Posts: 182
Joined: Mon Aug 10, 2020 9:04 am
Location: West Yorkshire, UK
Contact:

Re: Elk Player

Post by chrissawer »

Great achievement, I will be interested to see your source code when it's released.

Would you be interested in giving a demo at one of the Thursday night developer ABUG meetings on zoom? I would love to hear you talk through how it works.
User avatar
Negative Charge
Posts: 93
Joined: Sat Jan 16, 2021 1:35 pm
Contact:

Re: Elk Player

Post by Negative Charge »

chrissawer wrote: Wed Mar 24, 2021 5:49 pm Great achievement, I will be interested to see your source code when it's released.

Would you be interested in giving a demo at one of the Thursday night developer ABUG meetings on zoom? I would love to hear you talk through how it works.
Thanks Chris. A lot of the process has been eloquently documented by Simondotm here: https://github.com/simondotm/vgm2electron

My approach only really differs in how the source files are converted to produce the single channel arpeggios. This is still partially manual as it requires selecting just a few of the key channels in what could be a 8, 16 or 24 channel composition.

As an example (and maybe to inspire someone to work on a conversion of the game :) ), here’s one of my favourite tunes: Turrican II: The Final Fight. It took 5 or 6 attempts to pick the right channels for this one, and still you can hear the Electron struggling in a couple of places:

Image

https://www.youtube.com/watch?v=0oszuXXmdPQ

I don’t get a lot of free time in the evenings, so attending a dev night would be difficult. However, I will aim to write the approach up on GitHub once I’m in a position to publish the source.
User avatar
Negative Charge
Posts: 93
Joined: Sat Jan 16, 2021 1:35 pm
Contact:

Re: Elk Player

Post by Negative Charge »

A little more progress. I’ve been investigating playback at 200Hz and this appears to have a dramatic impact on the quality of the sound output (Check around 2:15 in the following video). I’m looking at 500Hz as a possibility, but memory constraints would severely limit the length of the track due to the volume of note data. Here’s one of my favourite arcade tracks played back at 200Hz:

Image

https://www.youtube.com/watch?v=5IZMIZx8JWU
User avatar
0xC0DE
Posts: 1300
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: Elk Player

Post by 0xC0DE »

Negative Charge wrote: Sat Mar 27, 2021 11:46 am A little more progress. I’ve been investigating playback at 200Hz and this appears to have a dramatic impact on the quality of the sound output (Check around 2:15 in the following video). I’m looking at 500Hz as a possibility, but memory constraints would severely limit the length of the track due to the volume of note data. Here’s one of my favourite arcade tracks played back at 200Hz:

Image

https://www.youtube.com/watch?v=5IZMIZx8JWU
Really impressive, both in quality and amount of memory needed :mrgreen: =D>
0xC0DE
"I program my home computer / Beam myself into the future"
:arrow: Follow me on Twitter
:arrow: Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
User avatar
Negative Charge
Posts: 93
Joined: Sat Jan 16, 2021 1:35 pm
Contact:

Re: Elk Player

Post by Negative Charge »

0xC0DE wrote: Sun Mar 28, 2021 11:05 am Really impressive, both in quality and amount of memory needed :mrgreen: =D>
Thanks! I've already made a few improvements to the playback at 200Hz, which requires a cycle-accurate delay of 5ms (adjusted for the processor it's running on) between the first and second notes every event from the interval timer (thanks to more code I've borrowed from the BitShifters) so I'm still working on the sound quality. 200Hz seems to be the sweet spot... 500Hz starts to deteriorate, and I end up with a quality similar to that of the sampled speech from Exile. I'm also left with very few cycles to update the display and it tends to just freeze.

I'm still using a 2.0 version of Exomizer, so hopefully I can squeeze the track data down a little bit further. Arpeggios mostly compress well due to the nature of the repeating tune patterns.
User avatar
*TAPE
Posts: 88
Joined: Sat Nov 14, 2020 9:01 pm
Location: Sheffield, Yorkshire
Contact:

Re: Elk Player

Post by *TAPE »

NC.... very impressive. =D> =D>

I would like to invoke Terry Thomas and say, "My dear chap, you're a delightful swine!"

It would appear you had this idea about 1 year before me!
I came up with this very idea about December last year.
As a youth I was always fiddling with making sound, stealing music from games, but was never good enough at assembler to do what you've done here.


You've run up against the memory issue.
One thing I was considering was looping.
Music is set at a given tempo. And for that tempo you know that notes will have a specific minimum length.... in which case you know you will need to repeat the note switching pattern n times, rather than 1 byte per switch.
...or, pardon my ignorance, is this what you've done?

The other thing I was considering was compressing mute.
You've got 0xFF as mute, what if the following number was a repeat number.
i.e. Silence lasts for n beats.
Saves many bytes on pauses..... although on faster music would end up costing more in space.
User avatar
Negative Charge
Posts: 93
Joined: Sat Jan 16, 2021 1:35 pm
Contact:

Re: Elk Player

Post by Negative Charge »

*TAPE wrote: Mon Mar 29, 2021 9:53 pm NC.... very impressive. =D> =D>

I would like to invoke Terry Thomas and say, "My dear chap, you're a delightful swine!"

It would appear you had this idea about 1 year before me!
I came up with this very idea about December last year.
As a youth I was always fiddling with making sound, stealing music from games, but was never good enough at assembler to do what you've done here.


You've run up against the memory issue.
One thing I was considering was looping.
Music is set at a given tempo. And for that tempo you know that notes will have a specific minimum length.... in which case you know you will need to repeat the note switching pattern n times, rather than 1 byte per switch.
...or, pardon my ignorance, is this what you've done?

The other thing I was considering was compressing mute.
You've got 0xFF as mute, what if the following number was a repeat number.
i.e. Silence lasts for n beats.
Saves many bytes on pauses..... although on faster music would end up costing more in space.
Thanks. I hope this inspires you to continue rather than deters. I make no claim over discovering this technique (simondotm and 0xC0DE showed the way with Bad Apple) and Nick Pelling was doing something similar over 30 years ago... my original inspiration, but didn’t have the knowledge to take it further at the time :-)

Recently I discovered http://ssb22.user.srcf.net/mwrhome/midi-beeper.html which renewed my interest. However, the limitations soon become apparent when using the OS Sound and Envelope commands.

With regards to memory limitations it really hasn’t been an issue to date. My original technique used the approach you describe where I tried to store repeat notes as a single entry plus duration. However, I ended up wasting bytes on most notes as I needed to store them as a word and most had a value that would fit in a single byte. For precise timing I needed to hook into the interval timer, and that requires fast data access at every increment. I soon realized Exomizer can compress this data far better than I can. For example, the Out Run track before manipulation and compression is over 260kb in size.

0xFF refers to the value that needs to be supplied to the ULA’s counter to represent silence (simondotm has details about it here: https://github.com/simondotm/vgm2electron). See FE06 and FE07 in the EUG for details. I actually turn off sound with FE07 when this byte occurs in the stream.

Looping is implemented for some tracks (check the BBC Music disc on my GitHub for examples), but I’ve still work to do on tracks that loop part way through rather than at the beginning.

I’m just finishing up the complete set of Out Run tracks which I’ll post to my GitHub repository (https://github.com/NegativeCharge/Releases) in the next few days. Some of these are over 8 minutes long and they’re getting towards the memory limit (having to borrow some screen memory) - however, when I get some time I’ll investigate SWRAM - I have one of RamTop’s excellent ElkSD64’s so just need to work out how to detect and utilise the extra memory.

I’d love to take this further given the time - I’m throwing away so many sound channels from tracks to get this to sound reasonable on the Elk. With the Beeb and it’s three channels plus noise I see the potential for 12 concurrent notes plus percussion. However, that one’s for another day :-)

Don’t be deterred by lack of asm experience - I’ve only touched 8086 assembler about 20 years ago, and am having fun writing 6502 assembler badly. You’ll find most of what you need in these very forums, and if not there are very helpful people here ready to offer assistance.
User avatar
Negative Charge
Posts: 93
Joined: Sat Jan 16, 2021 1:35 pm
Contact:

Re: Elk Player

Post by Negative Charge »

A quick update... I’ve added two .SSDs to my GitHub. The full Out Run soundtrack via Elk Player and a conversion of a number of Atari ST game and demo tracks.

I’ve also managed to get playback working at 1KHz via the ULA. Possibly not the best example, but here’s a conversion of the Shadow of the Beast theme from the ZX Spectrum version playing back at 1KHz. The raw files are huge, but Exomizer does a very good job of compressing them down to something playable on an unexpanded Electron:

Image

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

If anyone can point me in the direction of the best documentation for detecting and using sideways RAM on the Electron, that would be most appreciated. I have an ElkSD64 I’d like to put to good use :)
Post Reply

Return to “new projects and releases: demoscene”