Beeb MOD Player

new graphics/music demos - bitshifters, 0xc0de, The Master + others
User avatar
simonm
Posts: 316
Joined: Mon May 09, 2016 3:40 pm
Contact:

Re: Beeb MOD Player

Post by simonm » Thu May 12, 2016 10:46 pm

Doh. In fact I'm convinced of this now. I've filtered down to just channels 2+3 in the VGM and I can hear all kinds of other effects going on - it's one of those fancy tracks where they are rapidly interleaving tuned periodic noise with regular melody tones on channel 2. So I'm fairly sure the tuning fault is coming from somewhere else now. The quest continues...
(some awesome chip tunes out there for SN though, so hopefully all this will lead to a nice demo disk of new beeb music!)

User avatar
kieranhj
Posts: 923
Joined: Sat Sep 19, 2015 11:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Beeb MOD Player

Post by kieranhj » Fri May 13, 2016 7:05 pm

Your converted VGM tune sounds really nice, not pitchy at all! (Although I guess I don't have the original to compare with.)

I haven't had much luck with Julian's VGM player. :( The optimiser / compiler works on some files but produces invalid output with others (I suspect it was tuned for the music he was chosing for the demo.) I don't know OCAML so haven't tried to work out what's going on here.

I got the playback routine built in BeebAsm but the sound comes out as not garbage but absolutely not correct. :) The playback code isn't that complicated but I don't have any guaranteed correct reference data so I can't be sure.

I think I'll try some more files, could you supply your tone test perchance?, and then maybe I can rip known good data out the mode infinity demo ssd.
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

User avatar
simonm
Posts: 316
Joined: Mon May 09, 2016 3:40 pm
Contact:

Re: Beeb MOD Player

Post by simonm » Fri May 13, 2016 9:43 pm

Sure - here you go. There's two VGMs - one is the NTSC clocked original, and the other is the version I've re-tuned to 4Mhz.
I used Deflemask to create the VGM. Quite a handy tracker, but it only exports VGM, it doesn't load them, so I've included the DMF project file as well.
Attachments
PNTest.zip
Test VGM files
(1.34 KiB) Downloaded 40 times

User avatar
simonm
Posts: 316
Joined: Mon May 09, 2016 3:40 pm
Contact:

Re: Beeb MOD Player

Post by simonm » Fri May 13, 2016 10:04 pm

Here's a zip with some more converted VGM's for you to play with. All of the beeb ones are resampled to 50Hz update intervals.
Bear in mind my conversion script still has a few snags in it, and also some of the tunes need faster than 50Hz updates to sound ok.
Mission is particularly monstrous in its use of fast chip fx. If I can get that working I'll give myself a gold star lol
Attachments
VGMTest.zip
Some test VGMs ported from ntsc to beeb
(67.5 KiB) Downloaded 43 times

User avatar
kieranhj
Posts: 923
Joined: Sat Sep 19, 2015 11:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Beeb MOD Player

Post by kieranhj » Mon May 16, 2016 9:04 pm

I managed to get puppeh's (Julian) vgmproc convertor working and ported his player to BeebAsm (since I can't get his pasta assembler built on Windows.) See (or rather hear) the attached ssd for the result using chris_beeb.vgm. This player has advantages that it happily runs on the vsync event and has been battle tested in a couple of demos to run with data from swram (although I haven't ported this bit yet.) There are a few limitations however:

1. The toolchain is not straightforward:
- convert file.vgm to file.s using vgmproc in Cygwin (unless you're running a Linux dev environment!)
- convert file.s to BeebAsm format (essentially search & replace .word & .byte for equw & equb)
- embed the source file into the player (i.e. copy & paste)
- hard code the "beat length" into the source to generate the correct lookup / multiplication table

2. vgmproc does not handle the pitch / frequency differences for the Beeb SN chip - so your hard work is not in vain Simon!

3. some vgm files generate output that is invalid (i.e. can't be compiled due to value out-of-range for 8-bit values)

Point #1 can probably be improved by using a Windows native OCAML compiler (if there is one?) and tweaking the script to produce something closer to BeebAsm source by default.

#2 will be fixed by Simon's awesome script :) Not sure that you need to resample to 50Hz in this instance just adjust the frequency values

#3 is beyond my understanding as it relies on Julian's envelope compression algorithm (and ML which I have no knowledge of what-so-ever) - I will send him some sample source & output files that don't work to see if he is amenable to fixing it.

I should mention the envelope compression scheme isn't as effective as using Exomiser but it's not that far off and the resulting code is a lot simpler than my circular buffer effort (and doesn't require a 1k decode buffer.) Obviously my code could be made a lot simpler by limiting it to 50Hz playback.
Attachments
vgmproc_v3.zip
Another VGM player
(18.68 KiB) Downloaded 38 times
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

User avatar
simonm
Posts: 316
Joined: Mon May 09, 2016 3:40 pm
Contact:

Re: Beeb MOD Player

Post by simonm » Mon May 16, 2016 11:06 pm

Nice work Kieran! I looked over that vgmproc stuff, but it kinda blew my mind! Not any kind of toolchain I've seen before. You've done well, Jedi.

I really like the idea of scanning for volume/tone patterns to create instruments and basically reverse engineer the sequenced patterns, but the more I look at these complex tunes, the more I think that's going to be a pretty complex analysis & data format to get consistently successful output.

Have you seen 6502 inflate? It's a standard gzip unpacker, and claims to use only 764 bytes of workspace. Probably not as fast as exomizer, but I bet's it not far off. I get the impression that you can just fetch unpacked bytes as you need them from the compressed data stream without having to unpack the whole lot, so that might be handy. EDIT:<< I'm talking rubbish. It doesn't do this; so would need modifying to achieve this

FWIW chris.vgm gzipped from 26kb to 3kb. (in fact gzipped vgms are supported as standard for most vgm players - sometimes with .vgz extension)
I thought it might tick a few boxes: simplify the tool chain, meet your goals for playback of standard vgms, and squash tunes just enough to fit in memory without disk streaming.
The largest vgm i have (dance of the pharoahs - 73kb) gzips down to 12kb. Mind you, this one even uses the fixed frequency periodic noises so it's a bugger to re-tune!

FURTHER EDIT: Non starter. Cant stream zlib files (at least not on machines with limited ram), it's unpack all or unpack nothing. :( On reflection, I think you have the best solution with exomizer. At least this way you can keep data compressed in memory and stream as required at the cost of your 1kb buffer.

I'm still fiddling with the script - tidying it up a bit, bugfixing etc. but will commit to github soon.
Keep me posted - it's great to hear the updates. Time to form a new demo crew maybe! :)

User avatar
kieranhj
Posts: 923
Joined: Sat Sep 19, 2015 11:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Beeb MOD Player

Post by kieranhj » Tue May 17, 2016 8:11 pm

simonm wrote:Time to form a new demo crew maybe! :)
Demo crew you say? ;)

So I worked out what was happening with the vgms that produce "invalid" data from the vgmproc convertor - the data is valid, there's just too much of it! To get around this requires changing the player to handle 16-bit indices for the envelope lookups. Not a massive amount of work just a bit of a ball-ache because of the additional complexity of 16-bit multiplies etc.

The bigger challenge is the massive amount of bloat on the files when changing most of the data to be 16-bit. Changing the parser script to spit out BeebAsm compatible source was trivial but getting them compiled is a different matter. For example your en_beeb.vgm (original 49787 bytes) becomes 36449 bytes with 16-bit data. The good news is that it compresses down really well with Exomiser to 13049 bytes, the bad news is that not all of the data can be streamed into the player - the envelope tables need to be accessed randomly.

So, there are a number of solutions to these problems but I guess that comes down to what the ultimate goal is..! If we'd like to compile a music disk or two of hither-to unheard tunes played on the Beeb, but coming from other exotic platforms, then accuracy & fidelity is likely the primary factor and it would be OK to take over all of RAM make full use of Timer 1. If, on the other hand, we need a lightweight music player that runs off the vsync event for a new Beeb demo then the reverse is pretty much true.

FWIW I was dusting off Julian's player for the latter but it is a bit frustrating that it doesn't support the more interesting (read: complicated) chip tunes out there!
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

User avatar
tricky
Posts: 4782
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Beeb MOD Player

Post by tricky » Tue May 17, 2016 8:52 pm

Would using 8 bit indices, but with a larger granularity than 1 byte work, failing that, a table of 16bit indices indexed by an 8 bit value.
I don't really remember the format, so I might be talking rubbish!

User avatar
SarahWalker
Posts: 1320
Joined: Fri Jan 14, 2005 3:56 pm
Contact:

Re: Beeb MOD Player

Post by SarahWalker » Tue May 17, 2016 10:09 pm

On the off chance that anyone's still interested in MOD playback, I've found what I think to be the source for the converter...
Attachments
convmod.c
(11.17 KiB) Downloaded 46 times

User avatar
simonm
Posts: 316
Joined: Mon May 09, 2016 3:40 pm
Contact:

Re: Beeb MOD Player

Post by simonm » Wed May 18, 2016 12:04 pm

For sure! Extremely interesting, thanks Sarah.

User avatar
kieranhj
Posts: 923
Joined: Sat Sep 19, 2015 11:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Beeb MOD Player

Post by kieranhj » Thu May 19, 2016 7:00 pm

tricky wrote:Would using 8 bit indices, but with a larger granularity than 1 byte work, failing that, a table of 16bit indices indexed by an 8 bit value.
I don't really remember the format, so I might be talking rubbish!
I realised I was being an idiot - I don't need full 16-bit values for indices, an extra 2-bits per index (10 in total) is sufficicent for most of the vgm files I've come across. This would add an extra 25% not a full 100% to the file size but increases the complexity of the packing / unpacking.

Anyway, some noodlings: attached is a comparison of playback of a reasonably complex tune (fluid.vgm) on both my old player "vgmplay_fluid.ssd" and a 16-bit version of Julian's envelope compressed player "vgmproc16_fluid.ssd". The latter doesn't quite fit in memory so obliterates the top of MODE 7 screen - it's fine unless you scroll, of course :) (Also it doesn't detect the end of the tune so be prepared for ear-splitting garbage after 90 seconds.)

Simon - I've included the original fluid.vgm file - it could really do with some of your Beeb re-tuning magic please as some parts sound quite funky!

I'm going to do a few more tests but I'm coming to the conclusion that Julian's compression algorithm has diminishing returns on very fast / complex tunes as the number of unique "envelopes" becomes large. It might be easier to rewrite / optimise the generic vgm player for files that have been preprocessed to exactly 50Hz (with optional Exomiser compression support.)
Attachments
vgmproc v4.zip
Comparison of fluid.vgm playback
(62.8 KiB) Downloaded 40 times
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

User avatar
tricky
Posts: 4782
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Beeb MOD Player

Post by tricky » Thu May 19, 2016 7:36 pm

If you only need 10 bits and are prepared to align the envelopes to 4 bytes, you can fit the offset in 8 ;)

User avatar
kieranhj
Posts: 923
Joined: Sat Sep 19, 2015 11:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Beeb MOD Player

Post by kieranhj » Thu May 19, 2016 8:01 pm

simonm wrote:Here's a zip with some more converted VGM's for you to play with. All of the beeb ones are resampled to 50Hz update intervals.
Bear in mind my conversion script still has a few snags in it, and also some of the tunes need faster than 50Hz updates to sound ok.
Mission is particularly monstrous in its use of fast chip fx. If I can get that working I'll give myself a gold star lol
Have you used vgmtool? http://www.smspower.org/Music/VGMTool It has a few useful features including text dump out of the data in human readable form. Attaached are the chris_beeb and chris_ntsc files for comparison - you can see how the frequencies / notes differ.

You can also change the data in the header to specify the Beeb SN parameters - this doesn't do the retuning we're looking for, alas, but does mean you can preview exactly how an NTSC / SMS vgm is going to sound on a Beeb without your frequency conversion using vgmplay.exe.

There are also a collection of command-line vgm tools on GitHub but I haven't got them built yet: https://github.com/vgmrips/vgmtools
Attachments
chris_txt.zip
Text dump of chris_ntsc.vgm and chris_beeb.vgm
(217.19 KiB) Downloaded 30 times
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

User avatar
simonm
Posts: 316
Joined: Mon May 09, 2016 3:40 pm
Contact:

Re: Beeb MOD Player

Post by simonm » Thu May 19, 2016 10:25 pm

*rubs hands* ohhh nice find! This'll come in very handy. This last little tuning bug is really getting on my nerves! I have a hunch though, it wont be long before I squash it...
Simon - I've included the original fluid.vgm file - it could really do with some of your Beeb re-tuning magic please as some parts sound quite funky!
Oh boy and I thought Mission was a monster. This is an epic tune! Stand by while I nuke this noise tone bug once and for all.
(nice work on the playback experiments btw)

User avatar
simonm
Posts: 316
Joined: Mon May 09, 2016 3:40 pm
Contact:

Re: Beeb MOD Player

Post by simonm » Thu May 19, 2016 10:38 pm

The complex bit of the retuning is that we cant just process the tone write data as it comes in byte by byte - we need both hi and lo parts of the tone register to be gathered before we can determine the original tone frequency and then retune it accordingly. So there's a fair bit of pre-fetching required and buffered write back. Some of these data streams are utter madness though, with rapid interleaving of volume/pitch effects, so it's a bugger to work out exactly what is what. I've spotted a lot of places where there's redundant writes too (eg. set channel 1 volume 100%, set channel 0 tone X, set channel 1 volume 50% ie. so the last volume write to channel 2 supersedes the first volume write) so I'm curious to know why that happens (other than perhaps the original code that generated the tune had imperfections).
I've added a filter to my script that strips out channels, so that makes it a bit easier to focus just on channels 2 + 3 (the maverick channels).

All I know is this will be an ace new music demo disk once we get it all going! :)

User avatar
simonm
Posts: 316
Joined: Mon May 09, 2016 3:40 pm
Contact:

Re: Beeb MOD Player

Post by simonm » Fri May 20, 2016 11:17 am

Ok tracked it down. Some tunes emit some awkward sequences when using tuned white/periodic noise - eg. they set ch2 freq, then later on set ch2 vol, and maybe later on switch to tuned periodic noise on ch 3. So there's various scenarios my script now to handle them.
Attached retuned fluid.vgm for you Kieran. It's not resampled or anything - just retuned.
Nice tune!
I'm coming to the conclusion that Julian's compression algorithm has diminishing returns on very fast / complex tunes as the number of unique "envelopes" becomes large. It might be easier to rewrite / optimise the generic vgm player for files that have been preprocessed to exactly 50Hz (with optional Exomiser compression support.)
Kieran I just did a quick test to see how your 'raw/optimized' format idea might work out.
Supposing an encoding scheme as follows:
1 We quantize the VGM so there are fixed time intervals for each update (eg. 50Hz/60Hz/100Hz)
2 Each update, the music player submits 1 'packet' of N x 1-byte commands to the sound chip
3 Data format is a 1 byte header with number of commands in the packet, followed by N bytes of packet data. Packets are therefore limited to 255 commands, which seems plenty.
4 Repeat step 3 for duration of tune

In this schema, Fluid reduces from 43Kb as a VGM to 21Kb as a byte stream. Exomizer squashes the VGM to 11Kb and the byte stream squashes to 9Kb, so it appears there is a small saving to be had. Same approach with en_beeb.vgm squashes to 14.8Kb, so not quite as effective in this case as your other technique.
Attachments
fluid_beeb.zip
(7.16 KiB) Downloaded 34 times

User avatar
kieranhj
Posts: 923
Joined: Sat Sep 19, 2015 11:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Beeb MOD Player

Post by kieranhj » Fri May 20, 2016 1:33 pm

Nice work Simon! This sounds great.

I will dust off the vgmplay code tonight and rewrite to only handle fixed 50Hz timesteps. First pass will be to handle existing VGM format and just calculate the nearest multiple of 20ms for all wait commands that are not 50Hz. It should make things a lot simpler.

Alternatively, if you can send me a sample file in the proposed byte stream format (and matching quantized VGM) I am happy to see if I can get this working directly. Don't worry if you don't get chance, this will be step two and shouldn't be that much extra work after step one.

Just to note that we would need to handle packets with zero bytes of data (so just a 0 in the header and no commands) as there are plenty of tunes with long(ish) waits that are multiples of 20ms.

I'm not so fussed about absolute maximum compression ratios - provided tunes end up <16k they can fit in SWRAM.

Hmm, I need to update my tumbleweed GitHub repo..
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

User avatar
simonm
Posts: 316
Joined: Mon May 09, 2016 3:40 pm
Contact:

Re: Beeb MOD Player

Post by simonm » Fri May 20, 2016 2:40 pm

Good plan.
FWIW my quantizing approach is simply to simulate playing the VGM at full rate, but gather data commands into blocks until the desired playback interval (eg. 20ms) has elapsed, then flush the gathered data commands to the output steam and emit a WAIT50.
I get the impression most VGM players also take this approach.
I'll upload a byte stream file for you to test later - it was only a few lines of python to get it implemented. As you say, a 0 value packet header is simply a WAIT50. Might be worth bobbing an FF on the end to signify end of stream (so packet size limited to 254).
If we ever get a tune with more than 254 data commands per update interval, this format's no good but so far so good...
Now I've fixed the tuning bug, I'll work toward releasing the script.

User avatar
simonm
Posts: 316
Joined: Mon May 09, 2016 3:40 pm
Contact:

Re: Beeb MOD Player

Post by simonm » Fri May 20, 2016 2:45 pm

In fact it's just occurred to me that there's never going to be more than 11 bytes in a packet since that's the max you'll ever need to send to the sound chip to set the tone & volume of all 4 channels in one update.

User avatar
kieranhj
Posts: 923
Joined: Sat Sep 19, 2015 11:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Beeb MOD Player

Post by kieranhj » Fri May 20, 2016 4:56 pm

Thanks Simon. VGM also supports looping points but given that neither player I have at the moment does we can worry about that later!

I'll look out for your byte stream file. :)
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

User avatar
kieranhj
Posts: 923
Joined: Sat Sep 19, 2015 11:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Beeb MOD Player

Post by kieranhj » Fri May 20, 2016 8:14 pm

OK, now we're motoring. :)

Attached is v4 of my player that runs at 50Hz only with Exomiser crunched VGM files. I had a penny-dropping moment after your post Simon so this handles wait times of any lengths it just only sends the sound data every 20ms. This means that 60Hz NTSC files send two lots of sound data every 5th frame at 50Hz but this only seems noticeable on certain tunes - some of them sound really good! The code is 10x simpler so I'm much happier with it.

I've included some of the recent test tunes in the package, although they'll have to be compiled in. The default tune "pharaoh.vgm" is another doozy to test your retuning script on - it runs pretty quickly with a lot of effects. The code has compile options to run under the vsync event and also to treat 60Hz wait commands as 50Hz. This is helpful for pure NTSC tunes - they play 20% slower but you don't miss or trample any of the notes!

By default (not under events) the player will spit out the current number of samples it has to wait before playing the next sound data. For 50Hz tunes this will always be 0 of course but helpful to see how some of the other tunes are constructed. Oh, the code included should run on a vanilla Beeb as it's compiled at PAGE &1900 with standard 6502 instructions.

We're pretty close to getting a generic *vgmplay command - was wondering whether to go to the effort of making a service ROM..!?

Also, for a music disk type setup it wouldn't be difficult to dump out channel volume / pitch values to a memory location of choice for driving nice visualiser effects etc.
Attachments
vgmplay_v4.zip
Much simpler 50Hz only VGM player
(131.58 KiB) Downloaded 40 times
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

User avatar
simonm
Posts: 316
Joined: Mon May 09, 2016 3:40 pm
Contact:

Re: Beeb MOD Player

Post by simonm » Fri May 20, 2016 9:51 pm

Added bin file containing the raw data version of fluid vgm for your experimentation Kieran - hopefully formatted correctly! (not tested) - quantized to 50Hz
Attachments
fluid.vgm.bin.zip
raw chip data file for fluid.vgm at 50Hz
(7.41 KiB) Downloaded 31 times

User avatar
simonm
Posts: 316
Joined: Mon May 09, 2016 3:40 pm
Contact:

Re: Beeb MOD Player

Post by simonm » Fri May 20, 2016 10:45 pm

It's just a hunch, but I have a feeling that some of these would sound better at 60Hz or 100Hz... I'm a fussy listener and I'm sure I can detect a few flaws in the playback of the busier tunes when quantized to 50hz. Wasn't there a built-in 100Hz IRQ on the beeb? I seem to recall the BASIC sound engine used that too for its ADSR envelope processing.

User avatar
kieranhj
Posts: 923
Joined: Sat Sep 19, 2015 11:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Beeb MOD Player

Post by kieranhj » Fri May 20, 2016 10:48 pm

simonm wrote:Added bin file containing the raw data version of fluid vgm for your experimentation Kieran - hopefully formatted correctly! (not tested) - quantized to 50Hz
Cool. I changed the player quickly but I think the data is missing waits when there is no sound. Attached is the player ssd but you can hear it runs through the tune far too quickly. The output to screen is basically the format as described, one packet per line : NN dd dd dd .. (where NN is number bytes and dd are the data bytes.) There are no 0 length packets.

If you reassemble the code with OPTION_USE_BYTESTREAM = FALSE then it will use the original vgm file and output the same per packet data to the screen (although not including the first NN because I don't know the number of bytes that will pass through in a given frame yet.) You can see there are plenty of sections where there are multiple 0 length packets in a row.

Other than that the data looks right so we're close. :)

PS. I christened the format BGM in the comments but looks like this might already be taken!
Attachments
vgmplay_v5_missing_waits.zip
Plays VGM / BGM files (exo compressed)
(32.92 KiB) Downloaded 35 times
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

User avatar
Arcadian
Site Admin
Posts: 3657
Joined: Fri Nov 24, 2000 12:16 pm
Contact:

Re: Beeb MOD Player

Post by Arcadian » Fri May 20, 2016 11:07 pm

simonm wrote:It's just a hunch, but I have a feeling that some of these would sound better at 60Hz or 100Hz...
Ooh, if it's possible to 'uprate' VGM conversions to 60hz, could you take a look at these Master System/Ninja Gaiden tracks that Sarah converted a number of years back? As I'd love to hear these played at full tempo on a Beeb (well, BBC Master!) :)

Btw, what is the origin of the track contained within the VGMPlay#4 archive above? Don't think I'd heard anything quite like that before on the Beeb!

Following this thread with real interest btw - great work (even if 99% of the tech talk goes over my head!!).
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk

User avatar
kieranhj
Posts: 923
Joined: Sat Sep 19, 2015 11:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Beeb MOD Player

Post by kieranhj » Fri May 20, 2016 11:48 pm

Arcadian wrote:Ooh, if it's possible to 'uprate' VGM conversions to 60hz, could you take a look at these Master System/Ninja Gaiden tracks that Sarah converted a number of years back? As I'd love to hear these played at full tempo on a Beeb (well, BBC Master!) :)

Btw, what is the origin of the track contained within the VGMPlay#4 archive above? Don't think I'd heard anything quite like that before on the Beeb!

Following this thread with real interest btw - great work (even if 99% of the tech talk goes over my head!!).
You mean like this? :D (This will work on a regular Beeb not just a Master BTW.)

The VGM music player & conversion scripts will handle 60Hz tunes just fine. We're trying to figure out the line between accuracy & playback performance / complexity. I think we've found the right balance now.

The crazy tracks I found mostly came from "Battle of the Bits" http://battleofthebits.org/ They run music creation competitions (amongst other things) for a variety of retro sound chips.

Good news for us is that the Sega Master System used a variant of the SN chip in the Beeb and it has a reasonable following. The bad news is that it is clocked differently so a lot of the music sounds slightly (sometimes badly) out of tune (and they're usually played at 60Hz.) Fortunately Simon is working on his script to retune everything to sound correct on the Beeb, which should open up a whole new set of music we can mess with.

Weirdly the SMS section on BotB seems to have disappeared - fortunately I grabbed 56 tracks from the site a few months ago, including the crazy complex ones we've been using to test the limits. I'll find somewhere to upload an archive.
Attachments
vgmplay_NG_decisive.zip
Ninja Gaiden SMS - A Decisive Battle
(52.61 KiB) Downloaded 36 times
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

User avatar
kieranhj
Posts: 923
Joined: Sat Sep 19, 2015 11:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Beeb MOD Player

Post by kieranhj » Sat May 21, 2016 12:03 am

And because I'm feeling kind (read: my wife isn't here to tell me to go to bed) - here are four more. :) I should state that although these playback at the right speed they have not been retuned for the Beeb so might sound a little funky.

The final one from the disk - Samurai in Tsutenkaku - is about 2kb too large for me to fit it into the player without modification but it should play fine in theory.

Enjoy!
Attachments
vgmplay_NG_pursuit.zip
Ninja Gaiden SMS - Pursuit in Tokyo
(12.94 KiB) Downloaded 34 times
vgmplay_NG_geisha.zip
Ninja Gaiden SMS - Rescue Geisha
(24.06 KiB) Downloaded 32 times
vgmplay_NG_overcome.zip
Ninja Gaiden SMS - Overcome
(27.88 KiB) Downloaded 34 times
vgmplay_NG_enemy.zip
Ninja Gaiden SMS - The Land of Enemy
(13.71 KiB) Downloaded 34 times
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

User avatar
kieranhj
Posts: 923
Joined: Sat Sep 19, 2015 11:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Beeb MOD Player

Post by kieranhj » Sat May 21, 2016 12:17 am

simonm wrote:It's just a hunch, but I have a feeling that some of these would sound better at 60Hz or 100Hz... I'm a fussy listener and I'm sure I can detect a few flaws in the playback of the busier tunes when quantized to 50hz. Wasn't there a built-in 100Hz IRQ on the beeb? I seem to recall the BASIC sound engine used that too for its ADSR envelope processing.
Only just noticed this post in the flurry of the others. It wouldn't be that difficult to write a fixed 100Hz player, it would just have to use Timer 1 latched to send sound data exactly twice a frame rather than rely on the vsync event. For a music disk this might be a nice idea for quality purposes and you could still dump out data for simple visualiser fx.

For a full demo you really need it to be 50Hz and vsync'd so that the CPU load is predictable. Most of the interesting gfx effects I've been playing with (and hoping to compile into a demo) rely on abusing TImer 1 quite heavily and are timing sensitive vs the raster.

If you give me some 100Hz data I'll write it. :)

Footnote: just checked AUG and there is a 100Hz IRQ but it's driven off Timer 1. I'm not sure those two are mutually exclusive so that would probably break if you managed all the timer latches directly. Would have to check.
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

User avatar
kieranhj
Posts: 923
Joined: Sat Sep 19, 2015 11:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Beeb MOD Player

Post by kieranhj » Sat May 21, 2016 12:27 am

kieranhj wrote:The final one from the disk - Samurai in Tsutenkaku - is about 2kb too large for me to fit it into the player without modification but it should play fine in theory.
OK, so I managed to squeeze it into memory on Master only by fiddling with the compression settings and by using the screen buffer as the scratch space for the decompressor! It gives a slightly odd light show but plays back just fine. :)
Attachments
vgmplay_NG_samurai.zip
Ninja Gaiden - SMS - Samurai in Tsutenkaku
(71.73 KiB) Downloaded 41 times
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

User avatar
Arcadian
Site Admin
Posts: 3657
Joined: Fri Nov 24, 2000 12:16 pm
Contact:

Re: Beeb MOD Player

Post by Arcadian » Sat May 21, 2016 2:24 am

Wow, amazing, thank you so much! Sounds really good under BeebEm! :)
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk

Post Reply

Return to “new projects and releases: demoscene”