Fix volume range
This commit is contained in:
parent
8c6d5a522f
commit
1304806c11
@ -144,13 +144,13 @@ class GitMIDI(MIDIFile):
|
|||||||
(insertions - deletions).
|
(insertions - deletions).
|
||||||
|
|
||||||
deviation specifies the minimum and maximum volume (minimum is
|
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(
|
return max(
|
||||||
deviation,
|
deviation,
|
||||||
min(255 - deviation,
|
min(127 - deviation,
|
||||||
127 - deletions + insertions))
|
63 - deletions + insertions))
|
||||||
|
|
||||||
def sha_to_note(self, sha):
|
def sha_to_note(self, sha):
|
||||||
note_num = reduce(lambda res, digit: res + int(digit, 16),
|
note_num = reduce(lambda res, digit: res + int(digit, 16),
|
||||||
|
Loading…
Reference in New Issue
Block a user