Electro-Player

new graphics/music demos - bitshifters, 0xc0de, The Master + others
Post Reply
User avatar
TôBach
Posts: 9
Joined: Sun Jun 07, 2020 2:45 pm
Location: North Wales, UK
Contact:

Electro-Player

Post by TôBach »

Greetings folks!

I had always been wondering for quite a while about the sound capabilities of the Acorn Electron after seeing the "Racing the Beam" demo by 0xC0DE, I read up somewhere that it was a live data capture from an emulator, which seemed like quite a lot of faffing about that I wasn't really ready for, so I left it alone for a while.

But then one day I came across vgm2electron by simondotm and started getting quite excited about the possibilities, so I started looking for a player.
I eventually came across ElkPlayer by NegativeChange, as I am an Acorn hardware musician I wanted to be able to get my own tunes running on it, but there was no source, so I made my own! (No hard feelings my friend, I do much very appreciate your work!)

This was a great practice in learning about the hardware of the Acorn electron, I had to dig up several PDF's online of old Electron programming manuals, mostly for info about OS Vectors, ULA addresses, memory mapping and so on and even the odd old stardot thread, quite fun indeed!

Over a couple evenings I eventually cobbled together my own player out of what 6502 assembly knowledge I have, I am still learning!
Sadly I was only able to test in an emulator as I do not have an actual Electron, but one day hopefully!

Here is a video of a demonstration of the player as it stands at v1.0: https://www.youtube.com/watch?v=Vtd8cs2DVVU
And here is a link to the Github repository for the player: https://github.com/OSToastBach/Electro-Player

This was my first proper 6502 assembly project for any Acorn hardware and hopefully not my last!
Loving the active community here at stardot and I hope to be more active since I am a lurker most of the time haha, hope everybody is doing well!

- Oscar
User avatar
daveejhitchins
Posts: 7876
Joined: Wed Jun 13, 2012 6:23 pm
Location: Newton Aycliffe, County Durham
Contact:

Re: Electro-Player

Post by daveejhitchins »

Sounding good . . . =D>

Dave H.
Available: ARA II : ARA III-JR/PR : ABR : AP5 : AP6 : ABE : ATI : MGC : Plus 1 Support ROM : Plus 3 2nd DA : Prime's Plus 3 ROM/RAM : Pegasus 400 : Prime's MRB : ARCIN32 : Cross-32
User avatar
tricky
Posts: 7695
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Electro-Player

Post by tricky »

Sounds good.
I don't know the election, but is the hard but knowing how long to play bits of each note to make multiple notes at once sound good?
User avatar
DaveLecky
Posts: 554
Joined: Mon Jul 08, 2019 7:52 am
Location: Tullibody, Scotland
Contact:

Re: Electro-Player

Post by DaveLecky »

Very impressive, looking forward to your next performance......

Dave
Electron, Plus 3 and plus 1, AP6 and Home made MMFS PP SD interface
Electron Plus 1 Pres AP3/4 AP5 MGC ELKWiFi MRB
Beeb issue 7 with IFEL 16 socket Rom/Ram board
Master 128,CoPro
Master Compact
StrongA RPC,
Atom, Music 5000 and Keyboard
User avatar
flaxcottage
Posts: 5718
Joined: Thu Dec 13, 2012 8:46 pm
Location: Derbyshire
Contact:

Re: Electro-Player

Post by flaxcottage »

Not bad at all. Very clever. =D>
- John

Check out the Educational Software Archive at www.flaxcottage.com
User avatar
Negative Charge
Posts: 93
Joined: Sat Jan 16, 2021 1:35 pm
Contact:

Re: Electro-Player

Post by Negative Charge »

TôBach wrote: Fri Apr 30, 2021 6:56 am I eventually came across ElkPlayer by NegativeChange, as I am an Acorn hardware musician I wanted to be able to get my own tunes running on it, but there was no source, so I made my own! (No hard feelings my friend, I do much very appreciate your work!)
=D> No hard feelings at all! I'm glad to see others taking an interest in pushing the boundaries with regards to the musical capabilities of the Electron. I'm looking forward to seeing what you come up with - especially your own, original tunes for the Electron.

The difficult part isn't so much creating a player - it's the conversion process from multi-channel audio to something that sounds reasonable through arpeggiation on a machine with no volume control, dedicated sound chip and only a single channel.

If I can offer some advice, I would look into use of the 50Hz DisplayEnd / Vsync and 100 Hz interval timer, rather than relying on delay loops. It's then very easy to pump through converted ULA counter data at a consistent rate. You'll see my early examples used the same approach you do, and result in some odd speed up/slow down from time to time - it also limits the ability to update the UI.

I'll eventually open source my code, but I want to provide a complete separation between the player and UI, and give a proper sample application to play with. My time is very limited, so I can only dive into this occasionally making progress slow.

You can actually easily use the data output from Simon's conversion program with my player. It just requires a simple header to be added to the front of the binary file:

Screenshot 2021-04-30 132240.png

1) ELKP - 4 bytes
2) 05 - 2 bytes (50 Hz) - other options if you have data in the right format are 0F for 100Hz, 14 for 200Hz, 32 for 500Hz and 64 for 1 kHz
3) Track title - 28 bytes
4) Composer - 28 bytes

You then just compress the file with Exomizer using:

exomizer.exe raw -c -m 2048 input.bin -o 01.exo

...and replace file T01 on the following SSD with that file

https://github.com/NegativeCharge/Relea ... _Miner.ssd

The one gotcha is that Simon uses 00 for silence, while I use FF so a quick global replace in the binary will fix high sounding squeals from the ULA.

My experience to date is that 50Hz doesn't really sound great when you have a lot of notes playing simultaneously. You really need to be outputting notes at 200Hz minimum for the arpeggios to work, especially as there's no control over volume. I think these are at 200Hz (at least the ones that would fit into memory when compressed): https://github.com/NegativeCharge/Relea ... ut_Run.ssd

If you have a .VGM of your tunes you're willing to share, I'll gladly put it through my 1kHz converter and you can compare the difference.

Good luck with your journey!
User avatar
TôBach
Posts: 9
Joined: Sun Jun 07, 2020 2:45 pm
Location: North Wales, UK
Contact:

Re: Electro-Player

Post by TôBach »

Negative Charge wrote: Fri Apr 30, 2021 1:42 pm If I can offer some advice, I would look into use of the 50Hz DisplayEnd / Vsync and 100 Hz interval timer, rather than relying on delay loops. It's then very easy to pump through converted ULA counter data at a consistent rate. You'll see my early examples used the same approach you do, and result in some odd speed up/slow down from time to time - it also limits the ability to update the UI.
This has been on my to-do list! But I did not know how to properly implement it as I am still learning about the hardware, I think getting to toy with a UI might be a fun thing to try out, as I only made this as a little test it would be nice to see how far I can take this silly little project!
Negative Charge wrote: Fri Apr 30, 2021 1:42 pm The one gotcha is that Simon uses 00 for silence, while I use FF so a quick global replace in the binary will fix high sounding squeals from the ULA.
I had a similar problem, In the end as a temporary measure I just made it hold the previous note if it came across any 00's as I have not figured out how to silence the speaker yet.
Then I put an &FF at the very end of the music data so the player knows it has reached the end of the song and then does a system break.
Not the best solution but it does work! I have heard that the very high squeals are not audible on the real Electron though, only on emulators due to something about how the sound works on them? I am no expert!
Negative Charge wrote: Fri Apr 30, 2021 1:42 pm My experience to date is that 50Hz doesn't really sound great when you have a lot of notes playing simultaneously. You really need to be outputting notes at 200Hz minimum for the arpeggios to work, especially as there's no control over volume. I think these are at 200Hz (at least the ones that would fit into memory when compressed): https://github.com/NegativeCharge/Relea ... ut_Run.ssd
The arpeggiated music does sound a lot better at a higher speed, I will probably give this a go too some time once I have figured out how to properly use the 50Hz DisplayEnd and 100Hz interval timer.

Thank you very much for your advice, this weekend a v1.1 will be in the works! Thank you everyone for the nice comments too! :)

- Oscar
User avatar
roland
Posts: 5148
Joined: Thu Aug 29, 2013 9:29 pm
Location: Born (NL)
Contact:

Re: Electro-Player

Post by roland »

It sounds great. Good job!
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:
Post Reply

Return to “new projects and releases: demoscene”