code refactoring and gain controls mix

added templates so process and processDouble use the same code
Merge branch 'master' of https://github.com/vberthiaume/simpleDist