Change gain of SamplerVoice

Hello,

I am building a sampler and I want to change the gain of different samples that are played by the Synthesiser class. In the SamplerVoice I found to private variables : lgain and rgain. I build a subclass of SamplerVoice and changed the values of these two variables but it does not seem to change anything in the gain at all when I add these to the Synthesiser as voices.

Does anybody know why it is like this or has an idea how to achieve a gain change for sounds without changing the gain of the whole plugin?

Kind regards