From 1304806c11ceaf66b761f2b24840b82779d50111 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Thu, 26 May 2016 20:40:57 +0200 Subject: [PATCH] Fix volume range --- git-sound.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/git-sound.py b/git-sound.py index 97e7b85..d01a545 100644 --- a/git-sound.py +++ b/git-sound.py @@ -144,13 +144,13 @@ class GitMIDI(MIDIFile): (insertions - deletions). deviation specifies the minimum and maximum volume (minimum is - the value of deviation, maximum is 255 - deviation). + the value of deviation, maximum is 127 - deviation). """ return max( deviation, - min(255 - deviation, - 127 - deletions + insertions)) + min(127 - deviation, + 63 - deletions + insertions)) def sha_to_note(self, sha): note_num = reduce(lambda res, digit: res + int(digit, 16),