Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

midi/mid in android with Custom SoundFont loading support #2183

Open
kirito90 opened this issue Sep 19, 2020 · 5 comments
Open

midi/mid in android with Custom SoundFont loading support #2183

kirito90 opened this issue Sep 19, 2020 · 5 comments

Comments

@kirito90
Copy link

I find this https://github.com/VolcanoMobile/fluidsynth-android

may help adding midi/mid support with Custom SoundFont loading in zxtune for android

@Wohlstand
Copy link

Wohlstand commented Jan 7, 2021

Also, those libraries can be used for FM-Synth MIDI playing:
OPL3/OPL2 synth: https://github.com/Wohlstand/libADLMIDI
OPN2 synth (same chip as at Sega Megadrive): https://github.com/Wohlstand/libOPNMIDI
They don't need any SoundFont, they work differently and they do use a special instrument bank format. They have default built-in banks together with an option for users to load custom banks (WOPL format for libADLMIDI and WOPN for libOPNMIDI).

@Jobima1st
Copy link

VLC in Android kinda do it now, but I prefer zxtune

@vitamin-caig
Copy link
Owner

Extracted from libgme/game-music-emu#96 (comment)

Then, I will give some tips related to performance at these libraries (Anyway, that should be posted at your repo's issues rathar than here, but as a note to be copied in the future. Also, I lost my Bitbucket account, and glad I quickly resqued everything mine from it to my private self-hosted gitea and GitHub):

These libraries do support multiple different chip emulators with an ability to switch between them on the fly (the most accurate are Nuked emulators, but they were worst for mobile devices as they consume too much. Nuked OPL3 at least works on weak phone, but battery gets eaten quick. Nuked OPN2 just don't work on phone, it requires even more resources to work. The best chip emulator for phones at libADLMIDI is DosBox, the fastest one, and has average accuracy, somewhere it's inaccurate, but works well. At libOPNMIDI besties are MAME YM2612 and YMFM YM2612 - golden middle, the fastes is GEMS, but has worst accuracy, it works glitchy at SSG-EG parts). Can be an option for users.
It's an option to select number of chips to increase/decrease polihpony. Should be an option for users. Default for libADLMIDI can work just 2, or better 4. With DosBox on phones, 4 should be fine. The pronlem when selected embedded bank uses Rhythm-mode feature of OPL2/OPL3 chip.
For libADLMIDI, the ability to select one of embedded banks should be (the libALDMIDI by its API returns the list of available banks).
For libOPNMIDI, are no embedded banks, but you can supply a pile of bank files (the xg.wopn is default) and allow choice between them, but mainly use xg.wopn as default one, and allow user to select any bank from the file system. The libADLMIDI also supports custom banks in WOPL format. These banks can be created/edited via my OPL3-Bank-Editor and OPN2-Bank-Editor.
For both libADLMIDI and libOPNMIDI:
The "automatical arpeggio" option suggested to be disabled by default, and be an option for users.
The "Volumes model" option should be available for users to switch
The "Channels allocation mode" should be available for users to switch
"Enable panned stereo" flag is also an option that allows to escape the left-center-right stereo limitation of chips, and use full-panning stereo (using a hack in chip emulators made by me and my friend @jpcima who gone two years ago into nowhere...)
Also, supported file formats:
libADLMIDI supports MID, RMI, XMI (also supported multi-track files!), MUS (Id's format), IMF (also Id's used in Wolfenstein and other games), CMF, also EA's MUS format too but it's not so widely used.
libOPNMIDI supports MID, RMI, XMI (multi-track files supported too), and MUS, but no IMF and CMF.

@Wohlstand
Copy link

Copying same as above, but with keeping all the formatting:

Then, I will give some tips related to performance at these libraries:

  • These libraries do support multiple different chip emulators with an ability to switch between them on the fly (the most accurate are Nuked emulators, but they were worst for mobile devices as they consume too much. Nuked OPL3 at least works on weak phone, but battery gets eaten quick. Nuked OPN2 just don't work on phone, it requires even more resources to work. The best chip emulator for phones at libADLMIDI is DosBox, the fastest one, and has average accuracy, somewhere it's inaccurate, but works well. At libOPNMIDI besties are MAME YM2612 and YMFM YM2612 - golden middle, the fastes is GEMS, but has worst accuracy, it works glitchy at SSG-EG parts). Can be an option for users.
  • It's an option to select number of chips to increase/decrease polihpony. Should be an option for users. Default for libADLMIDI can work just 2, or better 4. With DosBox on phones, 4 should be fine. The pronlem when selected embedded bank uses Rhythm-mode feature of OPL2/OPL3 chip.
  • For libADLMIDI, the ability to select one of embedded banks should be (the libALDMIDI by its API returns the list of available banks).
  • For libOPNMIDI, are no embedded banks, but you can supply a pile of bank files (the xg.wopn is default) and allow choice between them, but mainly use xg.wopn as default one, and allow user to select any bank from the file system. The libADLMIDI also supports custom banks in WOPL format. These banks can be created/edited via my OPL3-Bank-Editor and OPN2-Bank-Editor.
  • For both libADLMIDI and libOPNMIDI:
    • The "automatical arpeggio" option suggested to be disabled by default, and be an option for users.
    • The "Volumes model" option should be available for users to switch
    • The "Channels allocation mode" should be available for users to switch
    • "Enable panned stereo" flag is also an option that allows to escape the left-center-right stereo limitation of chips, and use full-panning stereo (using a hack in chip emulators made by me and my friend @jpcima who gone two years ago into nowhere...)
  • Also, supported file formats:
    • libADLMIDI supports MID, RMI, XMI (also supported multi-track files!), MUS (Id's format), IMF (also Id's used in Wolfenstein and other games), CMF, also EA's MUS format too but it's not so widely used.
    • libOPNMIDI supports MID, RMI, XMI (multi-track files supported too), and MUS, but no IMF and CMF.

I'll append anything also if I remember...

Oh! It's suggested to gain the output 2x by default, otherwise, the output volume will be too quite...

@Wohlstand
Copy link

VLC in Android kinda do it now, but I prefer zxtune

I actually have VLC plugins for my libs, but for Android, I have to recompile the whole VLC by myself to add them into build. And, Android version of VLC as I know, lacks fine tune of each single codec like desktop versions has.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants