electronoora / webaudio-mod-player

MOD/S3M/XM module player for Web Audio
https://mod.haxor.fi/
MIT License
364 stars 54 forks source link

Added channel muting and volume control for basic interactivity. #34

Open jon-heard opened 10 months ago

jon-heard commented 10 months ago

I added two new fields to channels: interactiveMute and interactiveVolume.

The new fields allow this library to be used in an interactive, if simplistic, way. By controlling how much presence different channels have, you can alter the music's effect. This can be useful for interactive media, such as games.

Note - I gave the fields the prefix interactive to separate them from other channel fields, since these fields should NOT affect the song itself, just how it's rendered. For example, you can change a channel's interactiveVolume from 1.0 to 0.5, and any in-song volume changes will continue as normal, just quieter.