Skip to content
This repository was archived by the owner on May 16, 2023. It is now read-only.

Play MIDI files #107

@page200

Description

@page200

Since there's no "Discussions" tab in this repo (and this discussion affects potential add-ons and bugfixes), I'm opening this issue to discuss how to play MIDI files. This discussion started at mudcube/MIDI.js#268 (comment) and mudcube/MIDI.js#268 (comment) with @urobot2011 in the repo of MIDI.js, whose SoundFont loader soundfont-player replaces.

The readme of soundfont-player says "It is a much simpler and lightweight replacement for MIDI.js soundfont loader (MIDI.js is much bigger, capable of play midi files, for example, but it weights an order of magnitude more).". Therefore:

  • By implementing the capability of playing MIDI files, we might partially revert to what MIDI.js does and thus again run into the problem that the first notes play too late. As a quick test, if you use the time argument of play() or schedule() in soundfont-player to program a melody where many instruments play fast in the beginning (for example playing fast scales), does the melody play with the correct rhythm?
  • What's lacking in soundfont-player is the loading of MIDI files. We could borrow that functionality from other projects than MIDI.js. For example:

Another thing: When I tried the official demo of MidiPlayerJS months ago, which uses soundfont-player, it had unstable playback, for example when switching quickly between windows. When I tried today, it seemed to use wrong instruments and the rhythm didn't seem perfect. I wonder whether that problem is due to MidiPlayerJS or soundfont-player. It might be due to soundfont-player because that webpage says "This MIDI player was built using MidiPlayerJS to read the file, and soundfont-player to load and play the sounds". I also wonder whether those are the fatal flaws that @urobot2011 mentioned at mudcube/MIDI.js#268 (comment) and grimmdude/MidiPlayerJS#94, or whether @urobot2011 meant another one.

I wonder what the change was compared to MIDI.js that affected the timing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions