[Patch] MIDI improvements, added MT-32, FluidSynth
[Patch] MIDI improvements, added MT-32, FluidSynth
These patches adds improvements and new additions to MIDI (patched against commit d3e175d).
The base patches (1 to 3) adds a few useful methods, updates soundopenal.c and changes MIDI to be handled as a device by PCem. After these patches MIDI device-selection is moved out from sb_16_config and sb_awe32_config and is instead configured separately, it should make it easy to enable it if more sound cards requires it or if an external MPU-401-card is emulated. With these changes it becomes much easier to add other types of MIDI-devices.
Patch 4 adds new deviceconfig-options: CONFIG_FILE and CONFIG_SPINNER. FILE adds an option for browsing for a file and SPINNER adds an up-down component with a configurable step-size. Unfortunately I couldn't figure out how to make it a spinner on Windows so it's an edit-box there.
Patches 5.1/5.1.1 adds built-in Roland MT-32 and CM-32L-emulation using MUNT 2.2.0. It requires mt32_pcm.rom and mt32_control in roms/mt32 for MT-32 and cm32l_pcm.rom and cm32l_control.rom in roms/cm32l for CM-32L.
Patch 5.2 adds support for FluidSynth. It is not built-in and has to be linked when building. On Linux add --enable-fluidsynth to the configure-command or add FLUIDSYNTH=1 if building from Makefile.* (works on Windows as well)
Patch 6.1 adds more options to sb_16_config and sb_awe32_config and support for intelligent-mode. It fixes for example a crash when trying to use MT-32 in Space Quest 3.
Patch 6.2 adds support for SBMIDI. This patch was provided by basic2004 (https://pcem-emulator.co.uk/phpBB3/view ... =150#p6136).
Unfortunately Allegro was left partially behind and it's not possible to configure MIDI through the GUI, but it should work if configured manually.
The base patches (1 to 3) adds a few useful methods, updates soundopenal.c and changes MIDI to be handled as a device by PCem. After these patches MIDI device-selection is moved out from sb_16_config and sb_awe32_config and is instead configured separately, it should make it easy to enable it if more sound cards requires it or if an external MPU-401-card is emulated. With these changes it becomes much easier to add other types of MIDI-devices.
Patch 4 adds new deviceconfig-options: CONFIG_FILE and CONFIG_SPINNER. FILE adds an option for browsing for a file and SPINNER adds an up-down component with a configurable step-size. Unfortunately I couldn't figure out how to make it a spinner on Windows so it's an edit-box there.
Patches 5.1/5.1.1 adds built-in Roland MT-32 and CM-32L-emulation using MUNT 2.2.0. It requires mt32_pcm.rom and mt32_control in roms/mt32 for MT-32 and cm32l_pcm.rom and cm32l_control.rom in roms/cm32l for CM-32L.
Patch 5.2 adds support for FluidSynth. It is not built-in and has to be linked when building. On Linux add --enable-fluidsynth to the configure-command or add FLUIDSYNTH=1 if building from Makefile.* (works on Windows as well)
Patch 6.1 adds more options to sb_16_config and sb_awe32_config and support for intelligent-mode. It fixes for example a crash when trying to use MT-32 in Space Quest 3.
Patch 6.2 adds support for SBMIDI. This patch was provided by basic2004 (https://pcem-emulator.co.uk/phpBB3/view ... =150#p6136).
Unfortunately Allegro was left partially behind and it's not possible to configure MIDI through the GUI, but it should work if configured manually.
- Attachments
-
- 170806-midi.zip
- (160.01 KiB) Downloaded 539 times
Re: [Patch] MIDI improvements, added MT-32, FluidSynth
Thanks bit, I fixed to enable MIDI for mainline PCem and your branch. Apply this patch if you done applying all of these MIDI patches.bit wrote:These patches adds improvements and new additions to MIDI (patched against commit d3e175d).
Re: [Patch] MIDI improvements, added MT-32, FluidSynth
What dependencies do I need for linking FluidSynth?
Re: [Patch] MIDI improvements, added MT-32, FluidSynth
I haven't built FluidSynth for Windows myself so I'm not sure, but basic2004 has done it so maybe he can help you.Battler wrote:What dependencies do I need for linking FluidSynth?
Re: [Patch] MIDI improvements, added MT-32, FluidSynth
I built it fine now but the number of additional DLL's it needs is enormous. :-/
Re: [Patch] MIDI improvements, added MT-32, FluidSynth
Sorry for late answers, I installed fluidsynth 1.1.6 using cmake in my MinGW.Battler wrote:What dependencies do I need for linking FluidSynth?
and I copied libfluidsynth.dll.a to libfluidsynth.a in my mingw32/lib directory.
These files needed for fluidsynth.Battler wrote:I built it fine now but the number of additional DLL's it needs is enormous. :-/
Code: Select all
libfluidsynth-1.dll
libgcc_s_dw2-1.dll
libglib-2.0-0.dll
libiconv-2.dll
libintl-8.dll
libpcre-1.dll
libstdc++-6.dll
libwinpthread-1.dll
You should include these DLLs to make archive.
and, can you port Munt 2.2.0 to 86Box?
Munt 2.2.0 added Nice ramp settings.
Check Patches 5.1 and 5.1.1.
Last edited by basic2004 on Tue 08 Aug, 2017 12:10 am, edited 2 times in total.
Re: [Patch] MIDI improvements, added MT-32, FluidSynth
@bit: no more remove -Wall arguments for midi_fluidsynth.c.
If I included -Wall argument, midi_fluidsynth.c failed to compile
But this issue can solved, borrow from ported 86Box's source. Thanks, Battler.
I replaced fluidsynth.c line 107
to
FluidSynth feature works very well, I tested.
If I included -Wall argument, midi_fluidsynth.c failed to compile
Code: Select all
gcc.exe -O3 -march=i686 -fomit-frame-pointer -msse2 -mstackrealign -Wall -Werror -fno-strict-aliasing -DUSE_NETWORKING -DPCEM_USE_FLUIDSYNTH -c midi_fluidsynth.c
midi_fluidsynth.c: In function 'fluidsynth_sysex':
midi_fluidsynth.c:107:37: error: pointer targets in passing argument 2 of 'fluid_synth_sysex' differ in signedness [-Werror=pointer-sign]
fluid_synth_sysex(d->synth, data, len, 0, 0, 0, 0);
^~~~
In file included from G:/backup-drivec/msys-pcem-fs116/mingw32/i686-w64-mingw32/include/fluidsynth.h:81:0,
from midi_fluidsynth.c:4:
G:/backup-drivec/msys-pcem-fs116/mingw32/i686-w64-mingw32/include/fluidsynth/synth.h:76:20: note: expected 'const char *' but argument is of type 'uint8_t * {aka unsigned char *}'
FLUIDSYNTH_API int fluid_synth_sysex(fluid_synth_t *synth, const char *data, int len,
^~~~~~~~~~~~~~~~~
I replaced fluidsynth.c line 107
Code: Select all
fluid_synth_sysex(d->synth, data, len, 0, 0, 0, 0);
Code: Select all
fluid_synth_sysex(d->synth, (const char *) data, len, 0, 0, 0, 0);
Re: [Patch] MIDI improvements, added MT-32, FluidSynth
I'm going to look into that.basic2004 wrote:and, can you port Munt 2.2.0 to 86Box?
Munt 2.2.0 added Nice ramp settings.
Check Patches 5.1 and 5.1.1.
Re: [Patch] MIDI improvements, added MT-32, FluidSynth
Excellent! This patch now allows my MT-32 to work on Intelligent mode games.
Re: [Patch] MIDI improvements, added MT-32, FluidSynth
These patches tweaks the buffer for MT-32 and FluidSynth so they sound better.
- Attachments
-
- 170813-mt32_update.patch
- (2.11 KiB) Downloaded 494 times
-
- 170813-fluidsynth_update.patch
- (2.03 KiB) Downloaded 463 times
Re: [Patch] MIDI improvements, added MT-32, FluidSynth
My soundfont has overwrittten to PCem's machine setting file when using FluidSynth.
This is my setting and my overwrittten soundfont file.
This critical bug appears in 17 August, I compiled PCem-wx-SDL2 in 17 August too, after applied fluidsynth buffer patch.
This is my setting and my overwrittten soundfont file.
Code: Select all
gameblaster = 0
gus = 0
ssi2001 = 0
voodoo = 0
model = 430vx
cpu_manufacturer = 0
cpu = 4
cpu_use_dynarec = 1
cpu_waitstates = 0
gfxcard = bahamas64
video_speed = 3
sndcard = sbawe32
midi_device = fluidsynth
cpu_speed = 14
has_fpu = 1
disc_a =
disc_b =
hdd_controller = none
mem_size = 32768
cdrom_drive = 0
cdrom_enabled = 0
cdrom_channel = 2
cdrom_path =
hdc_sectors = 0
hdc_heads = 0
hdc_cylinders = 0
hdc_fn =
hdd_sectors = 0
hdd_heads = 0
hdd_cylinders = 0
hdd_fn =
hde_sectors = 0
hde_heads = 0
hde_cylinders = 0
hde_fn =
hdf_sectors = 0
hdf_heads = 0
hdf_cylinders = 0
hdf_fn =
drive_a_type = 5
drive_b_type = 0
bpb_disable = 0
joystick_type = 0
mouse_type = 3
enable_sync = 1
netcard = ne2000
[Sound Blaster AWE32]
onboard_ram = 28672
base401 = 816
irq401 = 9
mode401 = 1
opl_emu = 0
[Joysticks]
joystick_0_nr = 0
joystick_1_nr = 0
[FluidSynth]
sound_font = C:\soundfont\masquerade55v006.sf2
output_gain = 100
chorus = 1
chorus_voices = 3
chorus_level = 100
chorus_speed = 30
chorus_depth = 80
chorus_waveform = 0
reverb = 1
reverb_room_size = 20
reverb_damping = 0
reverb_width = 1
reverb_level = 90
interpolation = 2
Re: [Patch] MIDI improvements, added MT-32, FluidSynth
I looked at the source and I found that it can happen if the soundfont is configured when creating a new config on the normal Windows-version. Do you think this is what happened to you?basic2004 wrote:My soundfont has overwrittten to PCem's machine setting file when using FluidSynth.
This is my setting and my overwrittten soundfont file.This critical bug appears in 17 August, I compiled PCem-wx-SDL2 in 17 August too, after applied fluidsynth buffer patch.Code: Select all
gameblaster = 0 gus = 0 ssi2001 = 0 voodoo = 0 model = 430vx cpu_manufacturer = 0 cpu = 4 cpu_use_dynarec = 1 cpu_waitstates = 0 gfxcard = bahamas64 video_speed = 3 sndcard = sbawe32 midi_device = fluidsynth cpu_speed = 14 has_fpu = 1 disc_a = disc_b = hdd_controller = none mem_size = 32768 cdrom_drive = 0 cdrom_enabled = 0 cdrom_channel = 2 cdrom_path = hdc_sectors = 0 hdc_heads = 0 hdc_cylinders = 0 hdc_fn = hdd_sectors = 0 hdd_heads = 0 hdd_cylinders = 0 hdd_fn = hde_sectors = 0 hde_heads = 0 hde_cylinders = 0 hde_fn = hdf_sectors = 0 hdf_heads = 0 hdf_cylinders = 0 hdf_fn = drive_a_type = 5 drive_b_type = 0 bpb_disable = 0 joystick_type = 0 mouse_type = 3 enable_sync = 1 netcard = ne2000 [Sound Blaster AWE32] onboard_ram = 28672 base401 = 816 irq401 = 9 mode401 = 1 opl_emu = 0 [Joysticks] joystick_0_nr = 0 joystick_1_nr = 0 [FluidSynth] sound_font = C:\soundfont\masquerade55v006.sf2 output_gain = 100 chorus = 1 chorus_voices = 3 chorus_level = 100 chorus_speed = 30 chorus_depth = 80 chorus_waveform = 0 reverb = 1 reverb_room_size = 20 reverb_damping = 0 reverb_width = 1 reverb_level = 90 interpolation = 2
I've made some changes on my GitHub, please try it and see if it fixed your issue.
Re: [Patch] MIDI improvements, added MT-32, FluidSynth
Thanks! this patch works well.bit wrote:I looked at the source and I found that it can happen if the soundfont is configured when creating a new config on the normal Windows-version. Do you think this is what happened to you?
I've made some changes on my GitHub, please try it and see if it fixed your issue.
Re: [Patch] MIDI improvements, added MT-32, FluidSynth
Great! I'm really sorry that it destroyed your SoundFont :(basic2004 wrote:Thanks! this patch works well.
Re: [Patch] MIDI improvements, added MT-32, FluidSynth
Don't worry, I used that was copied file(fast access for SSD), original was placed in another HDD.bit wrote:Great! I'm really sorry that it destroyed your SoundFontbasic2004 wrote:Thanks! this patch works well.
Re: [Patch] MIDI improvements, added MT-32, FluidSynth
This patch modifies the configuration manager on Windows to prevent saveconfig to write to the wrong place when CONFIG_FILE has been used.
- Attachments
-
- 170903-config_file_fix.patch
- (797 Bytes) Downloaded 425 times
Re: [Patch] MIDI improvements, added MT-32, FluidSynth
I combined these MIDI patches from this thread against PCem rev#9c1822d.
I hope to implement new MIDI features(mt32emu, fluidsynth) into PCem v13.
* Munt mt32emu version is 2.2.0. this requires those ROM files.
* FluidSynth requires those libraries based 1.1.6 (FluidSynth 1.1.7 works, maybe...)
I hope to implement new MIDI features(mt32emu, fluidsynth) into PCem v13.
* Munt mt32emu version is 2.2.0. this requires those ROM files.
* FluidSynth requires those libraries based 1.1.6 (FluidSynth 1.1.7 works, maybe...)
- Attachments
-
- pcem-9c1822d-midi.zip
- (164.69 KiB) Downloaded 441 times
- BoisterousSleet75
- Posts: 39
- Joined: Fri 11 Aug, 2017 3:06 am
Re: [Patch] MIDI improvements, added MT-32, FluidSynth
I'm also hope those MIDI features will be implemented to PCem v13.basic2004 wrote:I combined these MIDI patches from this thread against PCem rev#9c1822d.
I hope to implement new MIDI features(mt32emu, fluidsynth) into PCem v13.
* Munt mt32emu version is 2.2.0. this requires those ROM files.
* FluidSynth requires those libraries based 1.1.6 (FluidSynth 1.1.7 works, maybe...)
Long Live Marxism-Leninism-Maoism! ☭
- SarahWalker
- Site Admin
- Posts: 2054
- Joined: Thu 24 Apr, 2014 4:18 pm
Re: [Patch] MIDI improvements, added MT-32, FluidSynth
I don't think I really want to pull MUNT and FluidSynth into PCem, they seem like the sort of thing that should be external to the emulator.
Re: [Patch] MIDI improvements, added MT-32, FluidSynth
Adding MUNT to PCEM will allow you to potentially add the Roland LAPC-1 as an internal sound card option.
Re: [Patch] MIDI improvements, added MT-32, FluidSynth
Well, I enough current MIDI out devices with Windows, using LoopMIDI(virtual MIDI device) and some VSTi(Munt and BASSMIDI(similar with FluidSynth) for VSTi) instead mt32emu and fluidsynth.SarahWalker wrote:I don't think I really want to pull MUNT and FluidSynth into PCem, they seem like the sort of thing that should be external to the emulator.
but I don't know about Linux, did PCem use MIDI with ALSA or JACK in Linux?
and Mac OS X... maybe this uses CoreMIDI for System MIDI.
currently, no need for support mt32emu and fluidsynth if PCem supports system MIDI with all operating systems.
I want these.
1. PCem should playing MIDI out device correctly.
2. support SBMIDI with current MPU-401 UART mode.
3. support MIDI out device for all Sound Blaster cards using SBMIDI.
P.S. Joystick feature working very well! No crashes and no messed-up mapping. I tested with my XBOX One S controller.
- SarahWalker
- Site Admin
- Posts: 2054
- Joined: Thu 24 Apr, 2014 4:18 pm
Re: [Patch] MIDI improvements, added MT-32, FluidSynth
Okay, rev 879 gets MIDI working again with Windows, rev 880 adds Linux MIDI output via ALSA. For the latter, add '--enable-alsa' to the ./configure command line. It currently only supports hw devices, so you'll have to use VirMIDI to use software synths. I did confirm it works with Fluidsynth at least.