This would NOT change the user-operated system volume level, nor ignore it.
This would NOT replace each sound.channel's own volume level or volumeMod signal.
Instead, it would be a multiplier, 0–1 (maybe even > 1?) applied to ALL channels, on top of whatever volume each channel itself has, and on top of the user-selected system volume.
Unless there's some way to do this already that I missed... it could be something like: playdate.sound.setMasterVolume(n)
.
Use cases:
• A way to make your whole game quieter (or louder?) as a whole, without reworking the code for every change to the volume of every sample, synth, or channel.
• A way to make your game automatically quieter when headphones are plugged in—since headphones are already detectable. (That's my use case: I have dozens of sounds in multiple channels, with complex programmatically varying volumes... and it's all perfect on the internal speaker at max volume... but ear-piercing with headphones! I'm going to rework every volume reference in my code to include a "headphoneReduction" factor... but it would be awesome not to have to!)
• Plus, I don't think there's any way to control the default global sound channel? So if you've used that (common, I'm sure) then modifying your game volume as a whole calls for creating a custom channel and then revising your sound code to always use it.