IBM Music Feature Card/Yamaha FB-01

Developer's Forum, for discussion of bugs, code, and other developmental aspects of DOSBox.

Re: IBM Music Feature Card/Yamaha FB-01

Postby awgamer » 2017-5-11 @ 15:29

Merging imfc emulation into munt would be logical, or a different multi midi module project using munt as the base, where adding scc-1a and db50xg emulation would complete it.
awgamer
Member
 
Posts: 386
Joined: 2014-7-26 @ 07:42

Re: IBM Music Feature Card/Yamaha FB-01

Postby Great Hierophant » 2017-5-12 @ 02:51

awgamer wrote:Merging imfc emulation into munt would be logical, or a different multi midi module project using munt as the base, where adding scc-1a and db50xg emulation would complete it.


Merging FB-01 emulation (the synthesizer engine, preferably with IMFC firmware enhancements) into Munt may be feasible, but the remainder of the IMFC (the MIDI interface) is not. The MIDI interface must be handled by DOSBox. The same considerations that exclude the MT-32 emulation from official DOSBox (use of copyrighted original firmware) would apply to the IMFC/FB-01
User avatar
Great Hierophant
l33t
 
Posts: 2314
Joined: 2003-4-27 @ 08:20

Re: IBM Music Feature Card/Yamaha FB-01

Postby Scali » 2017-5-12 @ 07:09

Great Hierophant wrote:The same considerations that exclude the MT-32 emulation from official DOSBox (use of copyrighted original firmware) would apply to the IMFC/FB-01


So far I don't see any reason to use any of the original firmware for IMFC/FB-01 though.
The MT-32 needs the original firmware because the sounds are sample-based, and it won't sound accurate unless you use the original samples contained in the ROM.
The IMFC/FB-01 is just an FM synth, so the entire sound is generated algorithmically, and it's basically the same as OPL2/OPL3 emulation.

Having said that, perhaps DOSBox could take the same approach as other emulators such as PCem and UAE: support devices that require original firmware, but just don't include that firmware. Then you won't have to download and install MUNT seperately, you'd just have to drop the firmware into place.
Scali
l33t
 
Posts: 2769
Joined: 2014-12-13 @ 14:24

Re: IBM Music Feature Card/Yamaha FB-01

Postby lchiocca » 2017-5-12 @ 07:15

It's has been a long time since I've played with my IMF, but I *thought* that sierra games had their own custom instrument configurations. That's why the SQ3 sounded great, because it used non-default instruments. If you had a "raw" IMF emulator without the default instruments, then I *think* sierra games would still be able to play music.

Anyways, having a simple emulator without the ROM and allowing the end-user to simply download the ROM (easy to find on the net) and place it in DOSbox would be a good compromise.

I'll try something on my side: I'll try to get a ACK/NAK from IBM/yamaha if we can use the ROM in DOSbox.
lchiocca
Newbie
 
Posts: 17
Joined: 2006-9-17 @ 22:35

Re: IBM Music Feature Card/Yamaha FB-01

Postby Scali » 2017-5-12 @ 07:19

lchiocca wrote:It's has been a long time since I've played with my IMF, but I *thought* that sierra games had their own custom instrument configurations.


Yup, I've been testing mostly with LSL3, and it uploads two Voice Banks at the start, with big SysEx blocks (of about 6112 bytes, which broke DOSBox with its 1024 byte default SysEx buffer).
I suppose most games do that.

But I don't see why we would need the ROM for the default instruments.
Firstly, I believe they are specified in the manual. Secondly, you can just dump them with a SysEx command. So I don't think they would even be under any form of copyright (and if they are, we could do the same as mentioned above: distribute the emulator without the SysEx, so anyone with a real unit can dump it themselves, or download it elsewhere, legal or not).
Last edited by Scali on 2017-5-12 @ 08:18, edited 2 times in total.
Scali
l33t
 
Posts: 2769
Joined: 2014-12-13 @ 14:24

Re: IBM Music Feature Card/Yamaha FB-01

Postby awgamer » 2017-5-12 @ 07:20

With munt it's another process so distributed load unless using threading in dosbox, which hasn't been its forte.
awgamer
Member
 
Posts: 386
Joined: 2014-7-26 @ 07:42

Re: IBM Music Feature Card/Yamaha FB-01

Postby Great Hierophant » 2017-5-12 @ 15:08

Scali wrote:
lchiocca wrote:It's has been a long time since I've played with my IMF, but I *thought* that sierra games had their own custom instrument configurations.


Yup, I've been testing mostly with LSL3, and it uploads two Voice Banks at the start, with big SysEx blocks (of about 6112 bytes, which broke DOSBox with its 1024 byte default SysEx buffer).
I suppose most games do that.

But I don't see why we would need the ROM for the default instruments.
Firstly, I believe they are specified in the manual. Secondly, you can just dump them with a SysEx command. So I don't think they would even be under any form of copyright (and if they are, we could do the same as mentioned above: distribute the emulator without the SysEx, so anyone with a real unit can dump it themselves, or download it elsewhere, legal or not).


I think that you would only need to dump the built-in instruments (240) and configuration presets (4, slight differences between FB-01 and IMFC) in order to have all the unique data from an FB-01 or IMFC. Everything else, MIDI interpreter and optionally the LCD driver would be emulated by reverse engineering. Munt would be the best place for the emulation. It is certainly easier to dump your own FB-01's instruments via sysex than the MT-32's via an EPROM programmer.
User avatar
Great Hierophant
l33t
 
Posts: 2314
Joined: 2003-4-27 @ 08:20

Re: IBM Music Feature Card/Yamaha FB-01

Postby Scali » 2017-5-16 @ 11:44

Great Hierophant wrote:I think that you would only need to dump the built-in instruments (240) and configuration presets (4, slight differences between FB-01 and IMFC) in order to have all the unique data from an FB-01 or IMFC.


Thing is, if we build a delta-set of SysEx commands based on dumps, we would not be distributing any data from Yamaha directly. It's data that we have created ourselves, so I don't think there would be any legal problem distributing it.

Great Hierophant wrote:Munt would be the best place for the emulation.


Perhaps... sadly it's written in Qt, and I was unable to get the project to open and build correctly on my machine.
If someone could help me to either get the project set up in Qt properly, or convert it to Visual Studio, then I could use MUNT as a basis.
Scali
l33t
 
Posts: 2769
Joined: 2014-12-13 @ 14:24

Re: IBM Music Feature Card/Yamaha FB-01

Postby jal » 2017-5-17 @ 12:34

Scali wrote:Thing is, if we build a delta-set of SysEx commands based on dumps, we would not be distributing any data from Yamaha directly. It's data that we have created ourselves, so I don't think there would be any legal problem distributing it.

Wouldn't that count as a "derivative work"?


JAL
User avatar
jal
Member
 
Posts: 494
Joined: 2004-1-02 @ 15:30
Location: Amersfoort, Netherlands

Re: IBM Music Feature Card/Yamaha FB-01

Postby Scali » 2017-5-17 @ 14:10

jal wrote:Wouldn't that count as a "derivative work"?


I don't think it does... because then you could call any set of voice parameters a 'derivative work', because you'll always have some parameters that match up with some preset.
Scali
l33t
 
Posts: 2769
Joined: 2014-12-13 @ 14:24

Re: IBM Music Feature Card/Yamaha FB-01

Postby ommadawnyawn » 2017-6-24 @ 10:57

Are there any game ost/footage recordings with this card? I could only find these short samples: http://www.crossfire-designs.de/index.p ... rds&page=6
Edit: and this: http://sound.dosforum.de/
ommadawnyawn
Newbie
 
Posts: 30
Joined: 2016-9-03 @ 22:43

Re: IBM Music Feature Card/Yamaha FB-01

Postby Scali » 2017-6-24 @ 18:57

Here's a first quick-and-dirty patch to add IMFC support to DOSBox (patch against SVN revision 4024, latest at time of writing).
It emulates an IMFC at port 2A20h (the factory default).

What it currently does:
- Emulate enough of the IMFC to be detected by the Sierra IMF drivers, and play MIDI data in a 'dumb UART' mode.
- Translates IMFC-specific SysEx commands to Yamaha FB-01 compatible SysEx commands.
- Outputs MIDI data in the same way as the MPU401: data can be logged to a .MID file, and can be sent to a Windows MIDI device in realtime.

What you can do with it:
- If you connect the MIDI out of your DOSBox machine to a real FB-01 or IMFC, you should be able to at least get IMFC sound with any Sierra games, possibly others.
- You can log MIDI data of IMFC games to study how games use the synthesizer module.
- You can log any port reads/writes to the IMFC to see what IMFC software is trying to do, to debug and further develop the IMFC routines.

What is still missing:
- Support for MIDI input.
- Support for the onboard 8253 timer running at 4 MHz.
- Support for any other 'advanced' system commands and interrupts.
- Software emulation of the Yamaha FB-01/YM2164 synthesizer module core.
- Configuration settings for base address, interrupt and whatever else we might need (MIDI output settings are just taken from the [midi] section, shared with the MPU401).

Hopefully this early start will get other people interested to help and complete the emulation for IMFC.
I could use some help with wrapping the FB-01 emulator into a MUNT-like/VSTi-like interface, so that it can be connected to DOSBox.
Attachments
IMFC_alpha.patch
(10.36 KiB) Downloaded 11 times
Scali
l33t
 
Posts: 2769
Joined: 2014-12-13 @ 14:24

Re: IBM Music Feature Card/Yamaha FB-01

Postby Scali » 2017-6-24 @ 19:11

ih8registrations wrote:FB01KING.ZIP is a TSR, with the source, that "converts" an IMFC to an FB-01. http://cd.textfiles.com/swextrav1993/disk4/pcspkr/


In retrospect, this FB01KING driver seems to do the same SysEx translation from IMFC to FB-01 as I added to DOSBox.
Scali
l33t
 
Posts: 2769
Joined: 2014-12-13 @ 14:24

Re: IBM Music Feature Card/Yamaha FB-01

Postby Scali » 2017-6-27 @ 22:45

As I am studying the VFB-01 code in some more depth, it would seem that it is not quite what it says on the tin...
That is, it does contain a MIDI interpreter, and it does output to an YM2151 simulator, but it seems to concentrate mostly on regular MIDI commands.
It does support some SysEx for sending voice data, but it looks like it's some makeshift version rather than something that is actually compatible with the FB-01. The other SysEx commands seem to be missing in action altogether.

Anyway, first things first: I have created a simple routine that will feed it MIDI data, one byte at a time. For now, that should be enough to at least play a single note to the emulator.
Next step is to hook up its PCM output to a Windows double-buffering audio setup.
Once I have that, I will probably run into the above issue: it seems to need to load a config file with voice data, or receive a SysEx command to get its voices initialized. So I probably will not hear any sound when I hook it up to Windows. I will probably need to load the provided config file to initialize some voices to something useful.

Hopefully I will then at least have the basic functionality to have it play some MIDI data. I can then hook up my simple MIDI replay routine, so I can play .MID files (which I can grab from DOSBox).
From there, I will probably want to upgrade the YM2151 code to the latest MAME version first, and then see if I can implement enough SysEx commands to make this into a reasonably useful FB-01 emulator.
Scali
l33t
 
Posts: 2769
Joined: 2014-12-13 @ 14:24

Re: IBM Music Feature Card/Yamaha FB-01

Postby Scali » 2017-6-28 @ 21:31

Right, we have progress: I have just played the first note on the VFB-01 contraption I've currently made for Windows.
So it seems that the MIDI interpreter is tied correctly to the YM2151 emulator, and the YM2151 emulator's PCM output is tied correctly to the Windows waveOut API.
Apparently I did not even need to load a voice configuration file, since it seems the YM2151 voices get initialized to something that produces sound.
Nevertheless, there was a 'tone_sample.cfg' supplied with the VFB-01 sources, so I used that to see what happened. The sound indeed changes, so by the looks of things, most of VFB-01 is now up and running. Now I can see how this voice data relates to the SysEx commands that are implemented in VFB-01, and compare them to the real thing.

Sound-wise I don't have all that much yet, just a hardcoded MIDI note that I play on all channels... I could try to hook up the MIDI replay routine now. That should give me some kind of 'reference', which I could use to try and graft the latest YM2151 sources from MAME onto here, since the ones these are based on seem to date from around 1999/2000.
That is, I assume that won't be too much trouble, after which, I would only have two more task to complete:
1) Harness this emulation code into some kind of MIDI device, either MUNT-like or VSTi-like.
2) Extend the emulation of SysEx commands to make it fully FB-01-compatible.
Scali
l33t
 
Posts: 2769
Joined: 2014-12-13 @ 14:24

Re: IBM Music Feature Card/Yamaha FB-01

Postby Scali » 2017-6-28 @ 23:17

Okay, forget the new MAME code.
That has got to be the most disastrous code I've ever seen... First of all, for some reason, everything has been made into C++... and not just C++, but the kind that uses a whole lot of subclassing and dependencies, so a simple YM2151 emulation routine is now no longer just two isolated files, but pulls in everything and the kitchen sink. Your typical lasagne-code. Layer upon layer upon layer.
Secondly, it's not 'just' C++, no apparently, they thought they had to include all the latest whizbang features from C++11 and beyond... Filled with fancy 'constexpr', '=default' and whatnot. I don't even know what half of that stuff means yet, because I've never even encountered it until now. And I'm using VS2010 at the moment, so it won't compile like that anyway. Seems like I have to change compilers to make sense of this mess. Downgrading it to a more widespread C++ dialect seems to be too much work.

Getting the YM2151 code to work outside of MAME seems to be far from trivial. Perhaps it's better to just see what it is it actually does, and just strip it from any MAME-code, rather than trying to extract all the required MAME-code to run it as-is.
The emulator itself does not seem to be all that complicated. Sadly it's been completely rewritten since the earlier version, so the code isn't even remotely similar to the one used by VFB-01.
Scali
l33t
 
Posts: 2769
Joined: 2014-12-13 @ 14:24

Re: IBM Music Feature Card/Yamaha FB-01

Postby lchiocca » 2017-6-29 @ 05:28

Scali, I just had a look at the mame code for the ym2151... All the changes starting with the objectifying commit can be discarded. You could use the ym2151 from mame commit id ec5b9deadee9a2f95e0691f7246a8f4663ba3ba9. But you could also use the real C version from commit 18188cb13bc11ba743d19e28125c6d8ab940fb70 as well. There were no code changes that affected the processing.
lchiocca
Newbie
 
Posts: 17
Joined: 2006-9-17 @ 22:35

Re: IBM Music Feature Card/Yamaha FB-01

Postby Scali » 2017-6-29 @ 10:24

lchiocca wrote:Scali, I just had a look at the mame code for the ym2151... All the changes starting with the objectifying commit can be discarded. You could use the ym2151 from mame commit id ec5b9deadee9a2f95e0691f7246a8f4663ba3ba9. But you could also use the real C version from commit 18188cb13bc11ba743d19e28125c6d8ab940fb70 as well. There were no code changes that affected the processing.


Thanks, that's at least something.
The 'real C' version is still not quite C it seems, it still uses the attotime object here and there.
It also still referenced the 'emu.h' file, which pulls in everything but the kitchen sink. And it still uses device_t... So it really is C++ code.
Anyway, this file is in a state where I can still reverse most of that.
And I now have it working, yay!
Scali
l33t
 
Posts: 2769
Joined: 2014-12-13 @ 14:24

Re: IBM Music Feature Card/Yamaha FB-01

Postby lchiocca » 2017-6-29 @ 10:47

> And I now have it working, yay!

You mean, you've got dosbox to actually output sound when playing through the IMF?! Wow! That's great news!!
lchiocca
Newbie
 
Posts: 17
Joined: 2006-9-17 @ 22:35

Re: IBM Music Feature Card/Yamaha FB-01

Postby Scali » 2017-6-29 @ 10:51

lchiocca wrote:You mean, you've got dosbox to actually output sound when playing through the IMF?! Wow! That's great news!!


No, not yet. I mean that I got the new YM2151 code to compile, and it seems to make the correct sounds when I play my hardcoded MIDI notes.
So the upgraded YM2151 code is working.

But yes, now it is time to start making the connection between DOSBox and the YM2151 code. I will have to study MUNT and see how they did it.
Scali
l33t
 
Posts: 2769
Joined: 2014-12-13 @ 14:24

PreviousNext

Return to DOSBox Development

Who is online

Users browsing this forum: No registered users and 1 guest