Music 5000 in B-Em

want to talk about MESS/model b/beebem/b-em/electrem/elkulator? do it here!
Coeus
Posts: 1118
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Music 5000 in B-Em

Post by Coeus » Sat Dec 09, 2017 6:34 pm

hoglet wrote:...I'm finding that tracks played in Music 5000 are suffering audio break-up/stuttering. I've quickly switched back to the code on master, and that seems to be fine. Doubling the M5 buffering from 750 to 1500 seems to resolve the issue.
Dave, interestingly pixelblip found it too small too. When I was trying different values 750 worked for me without breakup, 600 showed breakup and this is on an i5 desktop machine.

It is unfortunate that there isn't one best size. At 3,000 it was great for having a good margin above the point people would experience breakup when playing from AMPLE scores but with at least 256ms latency it is pretty hard to play from a MIDI keyboard - it is quite likely to be a whole beat behind.

I did start to contemplate what additional delays there may be between handing the buffer off to OpenAL and hearing the sound. The M5000 having its own unique sample rate that is unlikely to match anything else and may well mean software resampling probably isn't helping and maybe that's one reason different CPUs need different amounts of buffering depending on how fast the resampling is. I also don't know if OpenAL is taking time to do 3D audio processing, just with 0s as the input parameters or whether it is clever enough to skip that bit and this could also use CPU and introduce latency.

We could make the buffer size configurable. That shouldn't be that hard, though it looks like it is not as trivial as I had hoped. Another option is to start withy a big buffer and switch down to a smaller one as soon as you play a MIDI note. Any other ideas?

User avatar
fordp
Posts: 965
Joined: Sun Feb 12, 2012 9:08 pm
Location: Kent, England
Contact:

Re: Music 5000 in B-Em

Post by fordp » Sat Dec 09, 2017 10:50 pm

hoglet wrote:Steve,

I've just been doing a bit of regression testing on the code in the sf/m4000 branch.

(And also trying to get the right packages installed on my new Ubuntu 16.04 (64 bit) system.)

I currently have the following in b-em.cfg:

Code: Select all

[midi]
jack_enabled = 0
alsa_seq_enabled = 0
alsa_raw_enabled = 0
alsa_raw_device = default
I'm finding that tracks played in Music 5000 are suffering audio break-up/stuttering. I've quickly switched back to the code on master, and that seems to be fine. Doubling the M5 buffering from 750 to 1500 seems to resolve the issue.

My CPU usage (in top) is consistently about 68%. This is a fairly old system now, using a Core 2 Quad Q9550.

Dave
This is the classic emulation issue of not processing in real time but in chunks and the trade off of latency versus realism.
FordP (Simon Ellwood)
Time is an illusion. Lunchtime, doubly so!

User avatar
pixelblip
Posts: 881
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Post by pixelblip » Sat Dec 16, 2017 12:20 pm

Hi there
Please can someone tell me how I can get the latency back down on windows please.............sorry I am back to windows for a while...........I spent so long in Linux with various distros I didn't get much done!
Do you have to re-compile it or can you change this in the cfg file (for windows)?

I might have a bash at some music!

It's really cool you are also looking at getting Music 2000 working. introducing midi with this would be ace.

Coeus
Posts: 1118
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Music 5000 in B-Em

Post by Coeus » Sat Dec 16, 2017 1:34 pm

pixelblip wrote:...Please can someone tell me how I can get the latency back down on windows please.
AFAIK both use the same OpenAL driver so it is a section in b-em.cfg like this:

Code: Select all

[sound]
buflen_music5000 = 738
It mist be a multiple of three and the default is 3,000. That 738 value works for me on my desktop machine but leads to the sound breaking up on my laptop so I have to set it bigger on that. You will have to experiment and see what works - smaller is lower latency but more risk of the sound breaking up.

User avatar
pixelblip
Posts: 881
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Post by pixelblip » Sat Dec 16, 2017 1:39 pm

Thanks a lot Coeus.
I couldn't see that setting in my b-em.cfg file in windows.......I have added it

User avatar
pixelblip
Posts: 881
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Post by pixelblip » Sat Dec 16, 2017 2:08 pm

Sadly ( no one's fault ) there seems to be some stops with it with apps hanging.......(e.g. the recorder can just stop saying 'LOADING M.REC' and nothing happens when you try to load it............sometimes it runs, sometimes not ........I am running it on a BBC B 128k

I guess the only way is to play into notepad with the keyboard...........for now.

User avatar
pixelblip
Posts: 881
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Post by pixelblip » Sat Dec 16, 2017 2:09 pm

Screenshot

I realise you've all done your very best with this to get it working so far...........I wonder why it does this
Attachments
Capture.PNG

Coeus
Posts: 1118
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Music 5000 in B-Em

Post by Coeus » Sat Dec 16, 2017 3:19 pm

pixelblip wrote:I realise you've all done your very best with this to get it working so far...........I wonder why it does this
Intersting. I never tried that, only the "Keyboard" option. It may be incomplete emulation of the hardware again as we had that issue with the M4 module prior to introducing the M4000 keyboard emulation. Prior to the M4000 work B-Em didn't even emulate the shift register mode of the 6522 the M4 uses to scan the keyboard so if you wanted to get the studio software to work without hanging you had to edit the !BOOT file not to load it.

I will see if I can have a look later. Probably will need to enable lots of debug and see what hardware this module is accessing.

BTW, have you tried it on a master? I think that's what the later Hybrid music stuff was designed for.

User avatar
pixelblip
Posts: 881
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Post by pixelblip » Sat Dec 16, 2017 5:00 pm

Cheers Coeus. I haven't tried it on a Master yet ( when I start B-EM as a master it says)
Acorn MOS
This is not a language
*

Is that missing a rom or something? - probably something basic!
I will try it when I get it going.....just finished a painting instead :lol:

I did add that latency value to the windows b-em.cfg file but I don't think it did anything (at least I didn't notice a differece)........it wasn't there in the b-em cfg file either ( on windows )....does it work if you copy and paste it in to the windows version?

Don't sweat debugging all this ...unless you are up for it!
If we can crack all this I've got a feeling I'm going to do some very good stuff ......I just have this feeling some space soundtracks will come along.......it will be fun to get back into Ample and combine with MIdi :)

PS I will google This is not a language - you have better things to do :lol: than to be talking me through that !

Coeus
Posts: 1118
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Music 5000 in B-Em

Post by Coeus » Sat Dec 16, 2017 7:44 pm

pixelblip wrote:Cheers Coeus. I haven't tried it on a Master yet ( when I start B-EM as a master it says)

Code: Select all

Acorn MOS
This is not a language
*
...
That';s a little odd. On a non-master machine it means it did not find any usable language ROM which usually means you haven't put one in. In B-Em that would mean there isn't one in the relevant roms directory for that model.

There are at least two things different about the master:
  • BASIC is in the megabit ROM along with the OS so you should never be without that unless yu have rolled your own OS ROM
  • There is a simple OS command interpreter in the Terminal ROM for the case there is no other language
Here is a typical ROM setup for the master in B-Em:
master-roms.png
If yours doesn't look at least similar, i.e. with BASIC in slot 12 then there is something wrong. The other possibility is that your CMOS (held in a file in B-em called cmos.bin) is corrupted. The master remembers which language you prefer and you can see this with '*STATUS':
status.png
It may give you trouble if this is set to a ROM slot that does not contain a language. If so, set it back to basic with:

Code: Select all

*CO. LANG 12
Back to the crashing recorder module I didn't get this on Linux when I tried either as Master of B+128. I will see if it is Windows-specific.

Coeus
Posts: 1118
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Music 5000 in B-Em

Post by Coeus » Sat Dec 16, 2017 8:19 pm

Also, apologies, I described the new syntax for tuning the buffer but while I had pushed that code to the Stardot GitHub I had not made a new release with Windows binary that included it. I have done that now and the new release is at https://github.com/stardot/b-em/release ... c4000-pre2

I have also tested that on Windows and the recorder does not crash there either on either B+128 or Master.

User avatar
pixelblip
Posts: 881
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Post by pixelblip » Sat Dec 16, 2017 8:43 pm

Ah well done! Thank you. I look forward to trying it!
I got it working (Master) now - I just downloaded B-em again (win32) and copied over all the contents apart from the b-em executable.

Some of the sounds aren't bad in the Music 5000.........the moog synth and a few synths are quite respectable. Getting the Recorder working will be so much easier.

Thank you for all your hard work with me so far, much appreciated :)

User avatar
pixelblip
Posts: 881
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Post by pixelblip » Sat Dec 16, 2017 9:02 pm

That is great now. No crashes ........really good :) Thanks a lot.
The latency does break up at 750 for me but it means I can play things in naturally so it's worth using that for recording.
It would be interesting to see if Linux is any better in terms of latency and jack but I realise you can't be spending all your time on this one thing......

Asio is the preferred thing in windows ( with the free ASIO4all ) but I don't know how difficult that is to pipe sound into.
I guess when you are writing one version using things like OPENAL it means you can get it working on different platforms at the same time.

Anyway it's fine Coeus for now - you have done wonders!
It will be exciting to see if Music 2000 comes together with midi output!

Coeus
Posts: 1118
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Music 5000 in B-Em

Post by Coeus » Sun Dec 17, 2017 10:45 pm

pixelblip wrote:...Asio is the preferred thing in windows ( with the free ASIO4all ) but I don't know how difficult that is to pipe sound into.
I guess when you are writing one version using things like OPENAL it means you can get it working on different platforms at the same time.
Yes, the whole approach of using Allegro and OpenAL is that it should be taking care of platform differences but that doesn't always work. Allegro claims to handle MIDI but it seems what that actually means is playing MIDI files which isn't quite what we need hence the platform-specific MIDI modules. Also we have platform-specific GUIs. In principle we could have platform modules for sound output in place of OpenAL but I have not done that so far as that leaves the question of which to write for on Linux - there's ALSA, PulseAudio and Jack, and because I know nothing of ASIO on Windows, though to be fair I knew nothing of MIDI on Windows either until Simon pointed me to some example code. Also B-Em, with the Music 5000 running, is mixing three sound streams all at different sample rates so there will need to be some re-sampling in there which at the moment OpenAL does for us.
pixelblip wrote:Anyway it's fine Coeus for now - you have done wonders!
It will be exciting to see if Music 2000 comes together with midi output!
I have logged Issue #36 to track this. So far I have managed to send a middle C from AMPLE to a real hardware MIDI port on Linux using ALSA raw MIDI so it is just a case of working through the other output options, including Windows.

User avatar
pixelblip
Posts: 881
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Post by pixelblip » Mon Dec 18, 2017 6:31 am

That's exciting to hear Coeus! I am going to try to learn Ample again. It will be interesting to compose in it and send it to a sound module and combine sounds.
I like the possibilities of randomness in music......Ample sounds ideal for that.

Coeus
Posts: 1118
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Music 5000 in B-Em

Post by Coeus » Wed Dec 20, 2017 2:03 am

pixelblip wrote:That's exciting to hear Coeus! I am going to try to learn Ample again. It will be interesting to compose in it and send it to a sound module and combine sounds.
I like the possibilities of randomness in music......Ample sounds ideal for that.
See https://github.com/stardot/b-em/releases/tag/m2000pre1 for a pre-release including Windows exe that has Music 2000 emulation.

User avatar
pixelblip
Posts: 881
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Post by pixelblip » Wed Dec 20, 2017 6:00 am

Fantastic ! Thank you so much.
It's going to be very interesting tinkering with this. Will make me make music In a different way....out of the box

Coeus
Posts: 1118
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Music 5000 in B-Em

Post by Coeus » Wed Dec 20, 2017 4:38 pm

pixelblip wrote:Fantastic ! Thank you so much.
It's going to be very interesting tinkering with this. Will make me make music In a different way....out of the box
Finally, after Windows had spend hours doing Windows update, I got to do the test I wanted to do previously. I used a USB MIDI cable between my laptop booted into Windows and my Linux machine which already has a MIDI interface. Then I was able to type notes into AMPLE on the Linux desktop machine and have them play on a Music 5000 emulated by the Windows laptop and vice versa.

I did discover one small bug with the saving of MIDI device names which I have fixed and put up a replacement release https://github.com/stardot/b-em/releases/tag/m2000pre2

User avatar
pixelblip
Posts: 881
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Post by pixelblip » Wed Dec 20, 2017 5:55 pm

Oh dear sorry you had to go back to windoze! I must admit I dodge from one to the other (Linux and Windows) but lately have been on Windows much more.....
You have really persevered with this all for me ( and I hope others!). Thank you so much. Especially as you don't have any Midi hardware!

Hopefully I can get a sci fi soundtrack done which I hope to combine with the piccies. It will be interesting to see if Ample can be used to trigger more modern things as well ........so watch this space!

User avatar
pixelblip
Posts: 881
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Post by pixelblip » Fri Dec 29, 2017 9:20 am

Hi there Coeus
Hope you had a good Christmas and Boxing Day.........and I wish you a Happy New Year......( in fact everyone! !)

I thought I'd dip my toes today into Ample and Music 2000.......
Can I ask did you have to run Music 5000 disk 2 to get Midi output working?
When I type

1 VOICES MIDIV into Ample it says
Mistake

So I guess I need to load the disk . If this is the case could the Music 5000 disk2 be bundled with B-EM please? I can't see it in there....sorry it could be me doing something wrong - just following the Music 2000 manual.

Thanks a lot...........

Coeus
Posts: 1118
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Music 5000 in B-Em

Post by Coeus » Fri Dec 29, 2017 2:40 pm

pixelblip wrote:...When I type

1 VOICES MIDIV into Ample it says
Mistake...
You need to load the M2 module. There is also the M4 module for the M4000 keyboard etc. I think the disc that is bundled with B-Em has had the !BOOT nobbled to avoid loading the modules for the harware that was not emulated as the M4 module would crash the machine prior to writing the M4000 emulation. If they are not on that disc, just not included in the !BOOT sequence, then let me know and I'll try to find a disc with them on.

User avatar
pixelblip
Posts: 881
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Post by pixelblip » Fri Dec 29, 2017 5:03 pm

Ahh thanks a lot.
I found it on that disk...........well done for replying.

The only thing left for me to do now is to work out midi output as I have a keyboard and a sound module ( so 2 midi inputs/outputs ). I think for Windows 7 it's in the registry somewhere ( default midi devices ).

Coeus
Posts: 1118
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Music 5000 in B-Em

Post by Coeus » Fri Dec 29, 2017 5:23 pm

pixelblip wrote:....The only thing left for me to do now is to work out midi output as I have a keyboard and a sound module ( so 2 midi inputs/outputs ). I think for Windows 7 it's in the registry somewhere ( default midi devices ).
The original Music 2000 has three MIDI out ports so B-Em emulates three output ports. On Windows it chooses the first three MIDI out devices it can find and assigns one port to each. You may be right that the registry determines which order they are enumerated in but I haven't looked into that. one is bound to be a buil;t-in wavetable synth. Once you have run B-Em with the M2000 emulation for the first time it saves to the config file which MIDI device to use for which output port so if you want to re-order them from within B-Em you can do it in the config file. Other than that you can get AMPLE to use different output ports with MIDILINE IIRC.

User avatar
pixelblip
Posts: 881
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Post by pixelblip » Fri Dec 29, 2017 5:46 pm

Ahh great sorry I missed that..........in which case I won't have to fiddle in the registry............
I can't wait to get started on this to see what comes out :)
It's really fun doing this.......sequencing on something old...it's so different.

User avatar
pixelblip
Posts: 881
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Post by pixelblip » Sat Jan 27, 2018 2:37 am

Haven't forgotten about this.....just need to revisit it.....as I couldn't get midi out ....it's having multiple devices I think. Still itching to do some music with it.

User avatar
pixelblip
Posts: 881
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Post by pixelblip » Sat Jan 27, 2018 4:23 am

One thing ....has anyone managed to compile the latest Beeb em for a Mac please? I don't know what is involved compared to Linux. I have a Mac here that would be great to use with it. Thanks

Coeus
Posts: 1118
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Music 5000 in B-Em

Post by Coeus » Sat Mar 03, 2018 10:56 am

Tip: If you are using the Music 5000 emulation turn off the internal sound filter option.

I have just been looking at the code concerned and the sound filter works on the summed output of the Music 5000, the internal sound chip, the SID and the printer port DAC.

The Music 5000 sounds better without the filter.

User avatar
pixelblip
Posts: 881
Joined: Wed Feb 04, 2015 7:19 pm
Contact:

Re: Music 5000 in B-Em

Post by pixelblip » Wed Mar 14, 2018 2:39 pm

Hi Coeus
Thanks for that.
I just couldn't get midi out working in the end :( I spent a lot of time on it but nothing came out.......and the latency was too high to play in live. I tried going into the registry and hacking around but had no luck. My Linux pcs aren't around at the moment either.

So at the moment I'm giving it a break and went back to dullsville pcs and Ipads to make music.I will be coming back to it I am sure.

One way around these might be to use another sequencer and then covert to Music 5000. I was thinking of the Island Logic Music system..............that let you play in notes from the keyboard live ......I always managed to get some good results from that. I wonder if someone out there is bright enough to write an Island Logic > Music 500 converter.

Of course I could always go back and program in Ample so there is away around but that is slow going to say the least.
It's a shame as midi in was amazing..........it was a eureka moment.

funkydelard
Posts: 12
Joined: Sat Mar 23, 2013 1:00 pm
Contact:

Re: Music 5000 in B-Em

Post by funkydelard » Thu Oct 04, 2018 9:31 am

I no longer own any bbc hardware. I am still interested in the Music 5000 and was very pleased when found this B-Em emulation package. As others have said the sound is not %100 but it never was that great to start with. I have played with the emulation and find as a player it all works very well. I then thought I would like to revive my skills at programming the system and maybe write some new music for it. I used to like the staff editor a lot and did most of my work with that. Using the emulator I can enter notes and make them play in the staff editor but am unable to NAME and MAKE the words. Am i missing a trick or does the emulation not go that far? If the latter is true I hope you will in time address this shortcoming. I haven't got as far as trying to save anything yet because I can't MAKE any words. I am more musician than computer nerd so am very grateful for the excellent work you have done so far. If you could ultimately make it possible to connect a midi keyboard and emulate the Music 4000 that would be wonderful.

Coeus
Posts: 1118
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Music 5000 in B-Em

Post by Coeus » Thu Oct 04, 2018 2:49 pm

funkydelard wrote:
Thu Oct 04, 2018 9:31 am
I haven't got as far as trying to save anything yet because I can't MAKE any words.
B-Em emulates the Music 5000 hardware, not the software that controls it so it runs with exactly the same AMPLE software as you would use on a real Music 5000. Defining words is a feature of the AMPLE software, not a hardware feature, so it should make no difference whether you are running AMPLE on B-Em or on a real BBC.

There are several of us here who remember the Music 5000 from BITD - I still have a Music 500 (almost identical) and Chris N had the complete set-up with Music 4000 keyboard and Music 2000 MIDI I/F at Cambrige ABUG. It will be worth posting screen shots of what you are trying to do and I am sure we can help.
funkydelard wrote:
Thu Oct 04, 2018 9:31 am
I am more musician than computer nerd so am very grateful for the excellent work you have done so far. If you could ultimately make it possible to connect a midi keyboard and emulate the Music 4000 that would be wonderful.
The Music 4000 is also emulated - it uses a host MIDI device and converts incoming MIDI to emulated Music 4000 keypresses. The Music 2000 MIDI interface is also emulated - that can both send and receive MIDI via any MIDI interface available on the host. None of this is well-documented, though. I think there may be notes in in further back in this thread but if you're stuck let me know and I'll try to help.

Unfortunately it is a bit laggy and hard to play. The lag is in the audio buffering of the Music 5000 output, not the keyboard emulation or MIDI so that applies to any input device. You can tune the output buffer size to help but this is one respect in which the real hardware is definitely better.
Last edited by Coeus on Thu Oct 04, 2018 2:51 pm, edited 1 time in total.

Post Reply