Kermalis / VGMusicStudio

🎵 A program that lets you listen to the music from popular video game formats. 🎵
GNU Lesser General Public License v3.0
264 stars 32 forks source link

App does not have a global volume setting #89

Closed citrusui closed 3 years ago

citrusui commented 3 years ago

Certain songs, such as BGM_JUNGLE from Kirby: Mass Attack (SDAT Engine) exceed the maximum volume and start clipping. The current VG Music Studio does not prevent this, even in playlist mode, as the volume slider only affects the sound after it has been sequenced, mixed, and down-sampled to 16-bit, 65.4KHz stereo audio.

There is also no way to open the Track Viewer to change the volume parameters of tracks -- all parameters are read-only. Implementing such a feature is a different task, but could theoretically prevent clipping from occurring.

Kermalis commented 3 years ago

I just checked, and that song is clipping, but not by much image

Are you sure the game doesn't clip normally? I use the same volume parameters from the sdat player as the game would.

citrusui commented 3 years ago

Thanks for the quick reply.

"Not by much" seems to be... a subjective term.

image

I do think the track normally clips, but even so, it's something that can be fixed. I believe the VGMS mixer internally uses float, correct? Perhaps the volume can be set (user-configurable) to turn down the song before the sample-depth conversion to 16-bit.

This is just one example, by the way. Many, many other songs from other SDATs clip, not just this game. The majority of songs don't, but I almost guarantee you'll find at least one song from every DS game exceeding max volume.

Kermalis commented 3 years ago

Well SDAT and DSE don't use floats internally anymore, they just use pcm16 the whole time. I know the DS uses something other than pcm16 but it's not complete yet, and I'm aware of some other songs clipping.

I left it as is before because this program's goal is accuracy. There are so many other players out there that can make each engine sound better in different ways, from interpolation to float to this kind of scenario.

I also made the volume slider affect the final output only, for that same reason. So that would be considered the "speaker volume" on your handheld

So I feel like it should be left as is, just because of the premise behind this program, if the original clips the same way. I know the mixer isn't 100% accurate (none of them are yet) but I think it should be as close as possible, since this is the only tool going for accuracy anymore, that I'm aware of.

Someone in my Discord has used VGMS's code and made their own SDAT player, so perhaps you can ask them if their tool can fix clipping, since their tool is just a general SDAT player with some tweaks

Maybe one day in the future I can have plugin support that can add this kind of tweak without it being a mandatory feature for everyone. I thought about plugins for a while now, since many people ask for obscure formats that I don't have time to add. Other formats would be better as part of the program than as a plugin, but stuff that alters the audio I feel should be a plugin, kinda like how foobar2000 does it.

Sorry if that's not the answer you wanted