mmontag / chip-player-js

Web-based music player for a variety of video game and chiptune music formats.
https://chiptune.app
GNU General Public License v3.0
324 stars 17 forks source link

Keep voices updated in MIDI player #61

Closed mmontag closed 3 years ago

mmontag commented 3 years ago

The "Voices" panel is slightly different for each player. In the case of the MIDI player, it displays the initial GM instrument on each MIDI channel (not MIDI tracks).

The instrument played on each channel can change during the course of the song with a "program change" event. The voices displayed in Chip Player then will be incorrect because it does not update.

We should intercept program change events and update a state map of Channel → Instrument inside the MIDI player.