X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=helpers%2F__init__.py;h=f5ad848b855324c7a9133a29533d4535bb9f210d;hb=571d767ab587c5090bc44d2d28ad206dd1327526;hp=9d6663893bc32634b1163f7a525b8b04a7bdf9a5;hpb=2e4049036ec4d90a9daeff606d821d2ac2d023ce;p=perso%2FImmae%2FProjets%2FPython%2FMusicSampler.git diff --git a/helpers/__init__.py b/helpers/__init__.py index 9d66638..f5ad848 100644 --- a/helpers/__init__.py +++ b/helpers/__init__.py @@ -131,7 +131,7 @@ def duration_to_min_sec(duration): def gain(volume, old_volume=None): if old_volume is None: - return 20 * math.log10(volume / 100) + return 20 * math.log10(max(volume, 0.1) / 100) else: return [ 20 * math.log10(max(volume, 0.1) / max(old_volume, 0.1)),