Page 1 of 1

libmodplug and song volume

Posted: Tue Oct 21, 2014 1:39 pm
by Pilo
Hi everyone!

I recently added music made with milkytracker in my löve game, but I noticed that the volume of the song is quite low.

I looked into love's sources and noticed that for the files opened with modplug the master volume is set to 128, which wouldn't be a problem if we can increase it via love API, but it seems it's not possible?
Even changing the source volume above 1.0 doesn't work (and wouldn't be a good way for doing this I think for keeping the "best" sound quality).

Is there any way to change this without recompiling love (which I did, setting the master volume to max value, ie 512, but it works of course only on my linux computer...)?

Or am I missing something?

Thank you for reading ;)

Pilo

Re: libmodplug and song volume

Posted: Tue Oct 21, 2014 1:48 pm
by Zilarrezko

Re: libmodplug and song volume

Posted: Tue Oct 21, 2014 2:35 pm
by Pilo
Not really, this will only lower the volume of everything, but I want to increase the volume of the music track only
I want to increase it so 0dBFS in the song will be 0dBFS on soundcard output when playing the song in the game (which is not possible I think, as the libmodplug master volume is set to 128 when I think it should be 512).

By now the music is very low, I can lower the other sound FX too, but in this case, the user as to increase is audio system sound to make it as loud as any other apps/game.

Re: libmodplug and song volume

Posted: Tue Oct 21, 2014 3:05 pm
by kikito
Pilo wrote:I want to increase the volume of the music track only
That looks like a job for [wiki]Source:setVolume[/wiki]

Re: libmodplug and song volume

Posted: Tue Oct 21, 2014 3:08 pm
by zorg
In the mean time, you could set every other source's volume below 1.0, so in a way, instead of raising the volume of the module you're lowering everything else; not the best solution, but at least it will work.

On the other hand, i believe that the master volume is "more correct" at 128 than at 512, mostly because, for one, milkytracker allows between 0 and 256 (according to its reference manual), not 0-512; and because in modplug tracker, it's between 0 and 128.
Throw those two facts together, and you'll get inconsistency with a reason: this isn't really a module thing, but a player thing, since, from the XM and MOD references i gathered, the master volume does not get saved in those formats (s3m-s and it-s do save the global volume (along with a bunch of others), and that has a range of 0-128, probably the reason why in mpt, it's in that range)

What may be happening, is that inside milkytracker, the application itself amplifies the final volume for you; that may be why it sounds more quiet with libmodplug/löve