Music 5000 in B-Em
Music 5000 in B-Em
Hi Guys,
For a bit of light relief from all the Raspberry Pi Co Pro tweaking (and at the behest of alex_farlie), today I had a go at adding Music 5000 support (from Beech) into B-Em.
The code now is in github, and seems to work.
https://github.com/hoglet67/b-em/commit ... a776d467cb
It's included in both the Windows and Linux builds, and there is a new item on the sound menu to enable it. Also, make sure to disable internal sound filter, as it clobbers all the bass.
Sound quality could possibly be improved, as I'm having to down-sample from Music 5000's 46.875KHz stereo to B-Em's 31.250KHz mono.
There a few other pieces still to add, like supporting save/load state, and persisting the configuration back to disk.
Here's a windows binary: Dave
PS Steve (Coeus) I did try to merge your VDFS work back into my fork, but it seems it doesn't compile on Windows. Is that expected?
For a bit of light relief from all the Raspberry Pi Co Pro tweaking (and at the behest of alex_farlie), today I had a go at adding Music 5000 support (from Beech) into B-Em.
The code now is in github, and seems to work.
https://github.com/hoglet67/b-em/commit ... a776d467cb
It's included in both the Windows and Linux builds, and there is a new item on the sound menu to enable it. Also, make sure to disable internal sound filter, as it clobbers all the bass.
Sound quality could possibly be improved, as I'm having to down-sample from Music 5000's 46.875KHz stereo to B-Em's 31.250KHz mono.
There a few other pieces still to add, like supporting save/load state, and persisting the configuration back to disk.
Here's a windows binary: Dave
PS Steve (Coeus) I did try to merge your VDFS work back into my fork, but it seems it doesn't compile on Windows. Is that expected?
Last edited by hoglet on Sat Oct 15, 2016 5:54 pm, edited 2 times in total.
Re: Music 5000 in B-Em
Nice, could you create a bundle with all the required dll's, alleg44, alut, zlib1, etc.
- Nigel
BBC Model B: ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, BeebZIF, etc.
BBC Model B: ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, BeebZIF, etc.
Re: Music 5000 in B-Em
Here you go:Pernod wrote:Nice, could you create a bundle with all the required dll's, alleg44, alut, zlib1, etc.
https://www.dropbox.com/s/eukub3y8kloq8 ... e.zip?dl=0
To try the Music 5000 stuff:
- Start B-Em (and make sure you are in Master 128 mode)
- Settings/Sound enable "Music 5000"
- Settings/Sound disable "Internal Sound Filter" (should already be disabled)
- Disc/Load Drive 0/2 as Music5000.ssd (in the discs directory)
- Shift F12 (to load the ROMs)
- Shift F12 (to load AMPLE)
- scroll down to Load Program and hit return
- enter ppach as a filename and hit return
- hit return one more time tom Run Program
Dave
-
- Posts: 179
- Joined: Sun Jul 07, 2013 10:46 pm
- Contact:
Re: Music 5000 in B-Em
Working as designed. Although ideally someone should clear the M5000 disc with the relevant people Dropbox can get fussy sometimeshoglet wrote:Here you go:Pernod wrote:Nice, could you create a bundle with all the required dll's, alleg44, alut, zlib1, etc.
https://www.dropbox.com/s/eukub3y8kloq8 ... e.zip?dl=0
...
Dave
Re: Music 5000 in B-Em
FYI, Chris Jordan, creator of the original Music 5000 and AMPLE has been very supportive of efforts to keep Music 5000 alive.alex_farlie wrote: Although ideally someone should clear the M5000 disc with the relevant people Dropbox can get fussy sometimes
And he's also reasonably active on stardot (CHRISJJ):
http://www.stardot.org.uk/forums/search ... 9&sr=posts
Dave
-
- Posts: 179
- Joined: Sun Jul 07, 2013 10:46 pm
- Contact:
Re: Music 5000 in B-Em
Well I've been testing stuff, and found some files in 8BS that won't necessarily play using the MUSIC 5000 disc supplied. Also trying to use AMPLE with a second processor locks up the emulator ( I have my suspicions it will do that on a real Beeb as well.). Perhaps C. Jordan can help figure out what's up with the iffy tunes.hoglet wrote:FYI, Chris Jordan, creator of the original Music 5000 and AMPLE has been very supportive of efforts to keep Music 5000 alive.alex_farlie wrote: Although ideally someone should clear the M5000 disc with the relevant people Dropbox can get fussy sometimes
And he's also reasonably active on stardot (CHRISJJ):
http://www.stardot.org.uk/forums/search ... 9&sr=posts
Dave
Re: Music 5000 in B-Em
When you say "locks up the emulator", do you mean it hangs and doesn't even respond to Ctrl-Break (F12)?alex_farlie wrote: Well I've been testing stuff, and found some files in 8BS that won't necessarily play using the MUSIC 5000 disc supplied. Also trying to use AMPLE with a second processor locks up the emulator ( I have my suspicions it will do that on a real Beeb as well.). Perhaps C. Jordan can help figure out what's up with the iffy tunes.
One interesting aspect of the Music 5000 is that all of the registers it implements are write-only.
What that means (I think) is there is no way that any software on the Beeb can be influenced by it's presence, or for that matter even detect whether it's connected or not.
In B-Em you can untick "Music 5000" in the settings menu, and AMPLE will still run, and go through the motions of playing music.
I think any conflicts or crashes you see would likely be happening on an original Music 5000 system as well.
Dave
-
- Posts: 179
- Joined: Sun Jul 07, 2013 10:46 pm
- Contact:
Re: Music 5000 in B-Em
(Well I can use Ctrl F12 to recover, so it's locking up the emulated BEEB, and I think it does this on the original as well.)hoglet wrote:When you say "locks up the emulator", do you mean it hangs and doesn't even respond to Ctrl-Break (F12)?alex_farlie wrote: Well I've been testing stuff, and found some files in 8BS that won't necessarily play using the MUSIC 5000 disc supplied. Also trying to use AMPLE with a second processor locks up the emulator ( I have my suspicions it will do that on a real Beeb as well.). Perhaps C. Jordan can help figure out what's up with the iffy tunes.
hoglet wrote: One interesting aspect of the Music 5000 is that all of the registers it implements are write-only.
What that means (I think) is there is no way that any software on the Beeb can be influenced by it's presence, or for that matter even detect whether it's connected or not.
In B-Em you can untick "Music 5000" in the settings menu, and AMPLE will still run, and go through the motions of playing music.
I think any conflicts or crashes you see would likely be happening on an original Music 5000 system as well.
Dave
Re: Music 5000 in B-Em
That's an interesting one. I had not heard of the Music 5000 prior to joining here. I do have a Music 500 somewhere but that definitely seems like a smaller unit and I am not sure where the software is. I assume the manufacturers did a range of these?
Which Windows compiler are you using to compile it?
I suppose it shouldn't be a surprise as I don't have a Windows development environment so I haven't tried compiling it on Windows but it wasn't my intention to write Linux-only code. It's mostly ANSI C and the small bits of the POSIX interface it uses are ones I thought Windows C compilers typically implemented.hoglet wrote:PS Steve (Coeus) I did try to merge your VDFS work back into my fork, but it seems it doesn't compile on Windows. Is that expected?
Which Windows compiler are you using to compile it?
Re: Music 5000 in B-Em
The Music 500 and Music 5000 are essentially the same device but the 5000 has a minor timing mod to the PCB allowing it to work reliably on a Master. The Music 500 can have this done essentially making it Master compatible and a 5000 all at the same time.Coeus wrote:That's an interesting one. I had not heard of the Music 5000 prior to joining here. I do have a Music 500 somewhere but that definitely seems like a smaller unit and I am not sure where the software is. I assume the manufacturers did a range of these?
To see the entire range of Hybrid Music System hardware, take a look here... http://www.retro-kit.co.uk/Hybrid-Music-System/.
The Music 3000 is essentially a Music 5000 but sat at a different address on the 1MHz bus.
There's also the Peartree Computers Music 87 which is again a Music 500/5000 but licensed Peartree Computers and shipped with different software.
Paul
Re: Music 5000 in B-Em
I'm using the same MinGW based environment that I use for Atomulator (which is think is how it was originally built). It uses GCC 4.6.2Coeus wrote: I suppose it shouldn't be a surprise as I don't have a Windows development environment so I haven't tried compiling it on Windows but it wasn't my intention to write Linux-only code. It's mostly ANSI C and the small bits of the POSIX interface it uses are ones I thought Windows C compilers typically implemented.
Which Windows compiler are you using to compile it?
This came from Kees, who I think got it from Phill.
It's pretty big (~500MB) so too big to upload here. If you are interested, I can upload a copy to dropbox.
Dave
Re: Music 5000 in B-Em
This is fantastic you got this working.
I think B-Em is a really nice emulator................
It would be cool if you could attach a midi keyboard and play into the 5000 like the 4000........that would be awesome.
Music 5000..........second time around it's even better
I think B-Em is a really nice emulator................
It would be cool if you could attach a midi keyboard and play into the 5000 like the 4000........that would be awesome.
Music 5000..........second time around it's even better
Re: Music 5000 in B-Em
Hi Davehoglet wrote:Here you go:Pernod wrote:Nice, could you create a bundle with all the required dll's, alleg44, alut, zlib1, etc.
https://www.dropbox.com/s/eukub3y8kloq8 ... e.zip?dl=0
To try the Music 5000 stuff:
- Start B-Em (and make sure you are in Master 128 mode)
- Settings/Sound enable "Music 5000"
- Settings/Sound disable "Internal Sound Filter" (should already be disabled)
- Disc/Load Drive 0/2 as Music5000.ssd (in the discs directory)
- Shift F12 (to load the ROMs)
- Shift F12 (to load AMPLE)
- scroll down to Load Program and hit return
- enter ppach as a filename and hit return
- hit return one more time tom Run Program
Dave
Just a note to say thanks for all the work you did on this.
I've always wanted an emulated Music 5000 but my software skills just weren't up to the task
of implementing it myself. Great job!
Now if only the evil downmix step could be removed without breaking the code and we could have the beautiful noises
of the music 5000 in all it's original glory and fidelity! (hint hint)
Regards
Hedge
Re: Music 5000 in B-Em
Yes, this annoys me as well.Hedge wrote:Now if only the evil downmix step could be removed without breaking the code and we could have the beautiful noises
of the music 5000 in all it's original glory and fidelity! (hint hint)
The problem is that currently B-Em shares an open OpenAL source, running at 31.25KHz, for internal, SID and Music5000.
https://github.com/hoglet67/b-em-ARCHIV ... enal.c#L73
Now, what I've only just spotted is that it uses a seperate source, running at 44.1KHz, for disk drive noise.
https://github.com/hoglet67/b-em-ARCHIV ... enal.c#L93
So in principle we could create a third source for Music5000 that runs at the correct rate of 46.875KHz (6MHz/128).
What I don't know is whether this would be any better, or whether it just moves the sound re-sampling into the sound card driver.
Might be worth a try though....
Dave
Re: Music 5000 in B-Em
I've been experimenting a bit this afternoon. I've created a dedicated OpenAL source for Music 5000, and an feeding it proper stereo samples at 46.875KHz sampling rate. This avoids having to re-sample to 31.25KHz in the B-Em Music 5000 Code.Hedge wrote: Now if only the evil downmix step could be removed without breaking the code and we could have the beautiful noises
of the music 5000 in all it's original glory and fidelity! (hint hint)
Now, I'm 99.9% sure that the sound card driver will re-sample this anyway, probably to 44.1KHz.
If you fancy being a guinea pig, then here's an experimental version you could try: Just copy b-em.exe over the top of your existing version.
I'm interested if you thing this is better, worse or about the same as the previous build.
What is your preferred test track?
Do you have a real Music 5000 as a reference?
If it sounds OK with one or two voiced, and rubbish with many voices, then it's possible the arithmetic is overflowing. This is easily fixed.
Edit: I'm pretty sure "In Concert" of the included disk is overflowing.
Dave
Re: Music 5000 in B-Em
I've just done a comparison between B-Em and BeebFpga, which is the nearest I have to real Music 5000 hardware.
As a test track I'm using A Pilgrim PachelBel (ppach) on Music5000.ssd
Frankly, B-Em sounds absolutely dreadful in comparison, with lots of noise.
This must be down to one of two things:
- the default linear resampling done by OpenAl
- a bug in the Music 5000 emulation in B-Em
The emulation code we are using came from Beech, and this in turn was based on BeebFpga, so they should in principle sound the same.
Dave
As a test track I'm using A Pilgrim PachelBel (ppach) on Music5000.ssd
Frankly, B-Em sounds absolutely dreadful in comparison, with lots of noise.
This must be down to one of two things:
- the default linear resampling done by OpenAl
- a bug in the Music 5000 emulation in B-Em
The emulation code we are using came from Beech, and this in turn was based on BeebFpga, so they should in principle sound the same.
Dave
Re: Music 5000 in B-Em
After a good debugging session with BigEd this afternoon, Music 5000 in B-Em is now sounding much much better.
It turns out there were a three bugs in the B-Em emulation of Music 5000 that were making it sound rubbish:
1. Each channel pair had two independent phase accumulators, which was causing glitches when modulating between channels.
You can clearly see that here: Compared to the FPGA implementation here: The original hardware definitely only has one phase accumulator per channel pair.
This in fact was the main cause of the rubbish sound.
2. The way amplitude was implemented was incorrect. It used a multiplication operator, where as in the log domain it should use addition.
3. One bit of dynamic range was being thrown away unnecessarily.
I'd like to get some feedback (if anyone is interested) before committing this code back upstream. So here's a test Windows build that includes it: There's a bit more detail and discussion in the issue if anyone is interested:
https://github.com/stardot/b-em/issues/11
Fixes in github are here:
https://github.com/hoglet67/b-em/commits/db-music5000
Overall the volume is a bit quiet still, but that a generic B-Em/openal issue.
Dave
It turns out there were a three bugs in the B-Em emulation of Music 5000 that were making it sound rubbish:
1. Each channel pair had two independent phase accumulators, which was causing glitches when modulating between channels.
You can clearly see that here: Compared to the FPGA implementation here: The original hardware definitely only has one phase accumulator per channel pair.
This in fact was the main cause of the rubbish sound.
2. The way amplitude was implemented was incorrect. It used a multiplication operator, where as in the log domain it should use addition.
3. One bit of dynamic range was being thrown away unnecessarily.
I'd like to get some feedback (if anyone is interested) before committing this code back upstream. So here's a test Windows build that includes it: There's a bit more detail and discussion in the issue if anyone is interested:
https://github.com/stardot/b-em/issues/11
Fixes in github are here:
https://github.com/hoglet67/b-em/commits/db-music5000
Overall the volume is a bit quiet still, but that a generic B-Em/openal issue.
Dave
- ThomasAdam
- Posts: 95
- Joined: Tue Feb 07, 2017 9:35 am
- Location: Southampton, England
- Contact:
Re: Music 5000 in B-Em
Thanks, Hoglet. I look forward to a pull-request. :)
Re: Music 5000 in B-Em
Hi Davehoglet wrote:After a good debugging session with BigEd this afternoon, Music 5000 in B-Em is now sounding much much better.
It turns out there were a three bugs in the B-Em emulation of Music 5000 that were making it sound rubbish:
1. Each channel pair had two independent phase accumulators, which was causing glitches when modulating between channels.
You can clearly see that here:
cb772110-ff49-11e6-8903-b0aee1ea7491.JPG
Compared to the FPGA implementation here:
cb76a97e-ff49-11e6-8cfd-6b3030ff5c29.JPG
The original hardware definitely only has one phase accumulator per channel pair.
This in fact was the main cause of the rubbish sound.
2. The way amplitude was implemented was incorrect. It used a multiplication operator, where as in the log domain it should use addition.
3. One bit of dynamic range was being thrown away unnecessarily.
I'd like to get some feedback (if anyone is interested) before committing this code back upstream. So here's a test Windows build that includes it:
b-em.zip
There's a bit more detail and discussion in the issue if anyone is interested:
https://github.com/stardot/b-em/issues/11
Fixes in github are here:
https://github.com/hoglet67/b-em/commits/db-music5000
Overall the volume is a bit quiet still, but that a generic B-Em/openal issue.
Dave
Yes, I gave that build a whirl and it is MUCH better now
More thanks are in order!
All the best
Hedge
Re: Music 5000 in B-Em
Brill work Hoglet. Thank you for your effort............you have really gone into detail........I can't wait to try it out in B-em soon.
Re: Music 5000 in B-Em
I can't compiling on Linux Mint 17.3
I can't find even the Makefile.linux
Some help please?
I can't find even the Makefile.linux
Some help please?
2xElectron, 3xBBC B, BBC Master.
2xAcorn A310, A420/1, 2xA3000, 2xA3010, A3020, A4000, A5000.
2xRISC PC, Acorn Pocket Book, Acorn Pocket Book II.
2xAcorn A310, A420/1, 2xA3000, 2xA3010, A3020, A4000, A5000.
2xRISC PC, Acorn Pocket Book, Acorn Pocket Book II.
Re: Music 5000 in B-Em
What source tree are you trying to compile (as this pull request hasn't actually been merged yet)?bakoulis wrote:I can't compiling on Linux Mint 17.3
I can't find even the Makefile.linux
Some help please?
You'll need to provide a few more details of the errors. Please can you post a complete build log of:
Code: Select all
cd b-em
./autogen.sh
./configure
make clean
make
- ThomasAdam
- Posts: 95
- Joined: Tue Feb 07, 2017 9:35 am
- Location: Southampton, England
- Contact:
Re: Music 5000 in B-Em
... and, should ./configure fail, a copy of config.loghoglet wrote:What source tree are you trying to compile (as this pull request hasn't actually been merged yet)?bakoulis wrote:I can't compiling on Linux Mint 17.3
I can't find even the Makefile.linux
Some help please?
:(
You'll need to provide a few more details of the errors. Please can you post a complete build log of:DaveCode: Select all
cd b-em ./autogen.sh ./configure make clean make
Re: Music 5000 in B-Em
Code: Select all
~/b-em-master ᐅ ./autogen.sh
fatal: Not a git repository (or any of the parent directories): .git
configure.ac:8: error: AC_INIT should be called with package and version arguments
/usr/share/aclocal-1.14/init.m4:29: AM_INIT_AUTOMAKE is expanded from...
configure.ac:8: the top level
autom4te: /usr/bin/m4 failed with exit status: 1
aclocal: error: echo failed with exit status: 1
aclocal failed
This version was compiled and ready with only one command!
It needed make command from /src directory and was ready to go without errors!
2xElectron, 3xBBC B, BBC Master.
2xAcorn A310, A420/1, 2xA3000, 2xA3010, A3020, A4000, A5000.
2xRISC PC, Acorn Pocket Book, Acorn Pocket Book II.
2xAcorn A310, A420/1, 2xA3000, 2xA3010, A3020, A4000, A5000.
2xRISC PC, Acorn Pocket Book, Acorn Pocket Book II.
Re: Music 5000 in B-Em
I think the problem is you have somehow not checked out the git repository correctly.
Try starting afresh, and reclone:
Dave
Try starting afresh, and reclone:
Code: Select all
mkdir test
cd test
git clone -b db-music5000 https://github.com/hoglet67/b-em.git
cd b-em
./autogen.sh
./configure
make clean
make
Re: Music 5000 in B-Em
Yes, this was the problem. I had download the git from my browser as usual.
Last time it had worked
Last time it had worked
2xElectron, 3xBBC B, BBC Master.
2xAcorn A310, A420/1, 2xA3000, 2xA3010, A3020, A4000, A5000.
2xRISC PC, Acorn Pocket Book, Acorn Pocket Book II.
2xAcorn A310, A420/1, 2xA3000, 2xA3010, A3020, A4000, A5000.
2xRISC PC, Acorn Pocket Book, Acorn Pocket Book II.
Re: Music 5000 in B-Em
The build script is now smarter - it tries to construct a version string that include the git commit number, so when people get problems they can easily tell exactly what version they were running. So that does now need a proper clone from git to work.bakoulis wrote: Last time it had worked
By the way, I just (5 mins ago) fixed a small bug in the Music 5000 code that was causing a crash if the track ever clipped.
You might want to rebuild:
Code: Select all
cd b-em
git fetch
git rebase
make
Re: Music 5000 in B-Em
Thanks for the help and for the update!
2xElectron, 3xBBC B, BBC Master.
2xAcorn A310, A420/1, 2xA3000, 2xA3010, A3020, A4000, A5000.
2xRISC PC, Acorn Pocket Book, Acorn Pocket Book II.
2xAcorn A310, A420/1, 2xA3000, 2xA3010, A3020, A4000, A5000.
2xRISC PC, Acorn Pocket Book, Acorn Pocket Book II.
Re: Music 5000 in B-Em
Hey Dave could you post the windows exe with the clip bugfix here?hoglet wrote:The build script is now smarter - it tries to construct a version string that include the git commit number, so when people get problems they can easily tell exactly what version they were running. So that does now need a proper clone from git to work.bakoulis wrote: Last time it had worked
By the way, I just (5 mins ago) fixed a small bug in the Music 5000 code that was causing a crash if the track ever clipped.
You might want to rebuild:DaveCode: Select all
cd b-em git fetch git rebase make
Many thanks!
-hedge
Re: Music 5000 in B-Em
This work has now been pushed back upstream into the stardot b-em respostory.Hedge wrote: Hey Dave could you post the windows exe with the clip bugfix here?
Many thanks!
Edit: Replaced with later build a few posts down.
Dave
Last edited by hoglet on Mon Mar 06, 2017 5:14 pm, edited 1 time in total.