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

Volume control for external MIDI devices #79

Open mmontag opened 3 years ago

mmontag commented 3 years ago

Why not allow the Chip Player JS volume control to adjust the volume of Web MIDI devices? Even though devices have hardware volume controls, it can be a pain if you have multiple devices.

One of the following methods should work: 1) Sysex master volume 0xF0 0x7F 0xid 0x04 0x01 0xmm 0xnn 0xF7 (ignoring this if it appears in songs) 2) Multiply all channel volume events (CC 7) by master volume level 3) (worst case) Multiply all note velocities by master volume level

This is complicated by MIDI statefulness, but it doesn't have to be perfect. Consider restarting songs acceptable.