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

Standard MIDI file playback using instrument sound banks #25

Open
peteroupc opened this issue May 24, 2024 · 5 comments
Open

Standard MIDI file playback using instrument sound banks #25

peteroupc opened this issue May 24, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@peteroupc
Copy link

peteroupc commented May 24, 2024

I post the following issue to summarize ways to improve MIDI playback support in this library.

  • Support software synthesis of MIDI data stored in standard MIDI files (SMF, .mid), using instrument sound banks in SoundFont 2 (.sf2), downloadable sounds (.dls), and in OPL2, OPL3, and other FM synthesis sound banks, and possibly also in Timidity++/UltraSound patch format (.cfg). (The source code in fluidsynth, libADLMIDI, libOPNMIDI, and OPL3BankEditor may be useful here, but review the licenses for these projects.)
  • Support popular loop-point conventions found in MIDI files (see also Adding a few technical improvements to MIDI playback libsdl-org/SDL_mixer#101).
  • Support seeking of MIDI files such that a pause and resume function can be offered by a media player.

Just as an aside, a public-domain music synthesis library and instrument banks would greatly help improve MIDI playback support across the open-source ecosystem; however, I don't insist on that for purposes of this issue.

@nlaha nlaha added the enhancement New feature or request label May 28, 2024
@nlaha
Copy link
Owner

nlaha commented May 29, 2024

These are some great suggestions; I'm currently prioritizing features most useful for rhythm game developers where MIDI is usually synced to a pre-rendered audio file. That said, adding a built-in MIDI synthesizer (for SoundFont files) would be extremely interesting and I'll consider adding it if I have time.

@filipworksdev
Copy link

+1 for SoundFont sf2 support!

@elvisish
Copy link

I'd definitely like to see OPL3 support.

@nlaha
Copy link
Owner

nlaha commented Feb 2, 2025

Work for this is being done on the following branch: https://github.com/nlaha/godot-midi/tree/soundfont

Current status:

  • Initial SoundFont import/playback is functional
  • Need to move communication between MidiPlayer and AudioStreamPlayerMidi to C++
  • Might need to move audio synthesis to a separate thread
  • Support program changes

@nlaha nlaha self-assigned this Feb 2, 2025
@peteroupc
Copy link
Author

I see you have started work on this issue. But, as I suggest, any MIDI or sound files included in the repository to test the feature should be limited to files and works in the public domain.

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

No branches or pull requests

4 participants