|
@ -330,10 +330,10 @@ pillarOfFifth = [ |
|
|
|
|
|
|
|
|
def midiPitchLimiter(pitch, transpose): |
|
|
def midiPitchLimiter(pitch, transpose): |
|
|
if pitch + transpose < 0: |
|
|
if pitch + transpose < 0: |
|
|
logging.warning(f"Tranpose lead to a note below midi value 0: {pitch}. Limiting to 0. Please fix manually") |
|
|
logger.warning(f"Tranpose lead to a note below midi value 0: {pitch}. Limiting to 0. Please fix manually") |
|
|
return 0 |
|
|
return 0 |
|
|
elif pitch + transpose > 127: |
|
|
elif pitch + transpose > 127: |
|
|
logging.warning(f"Tranpose lead to a note above midi value 127: {pitch}. Limiting to 127. Please fix manually") |
|
|
logger.warning(f"Tranpose lead to a note above midi value 127: {pitch}. Limiting to 127. Please fix manually") |
|
|
return 127 |
|
|
return 127 |
|
|
else: |
|
|
else: |
|
|
return pitch + transpose |
|
|
return pitch + transpose |
|
@ -341,10 +341,10 @@ def midiPitchLimiter(pitch, transpose): |
|
|
def midiChannelLimiter(value): |
|
|
def midiChannelLimiter(value): |
|
|
"""makes sure that a midi channel is in range 0-15""" |
|
|
"""makes sure that a midi channel is in range 0-15""" |
|
|
if value > 15: |
|
|
if value > 15: |
|
|
logging.warning("Midi Channel bigger 15 detected: {}. Limiting to 15. Please fix manually".format(value)) |
|
|
logger.warning("Midi Channel bigger 15 detected: {}. Limiting to 15. Please fix manually".format(value)) |
|
|
return 15 |
|
|
return 15 |
|
|
elif value <0: |
|
|
elif value <0: |
|
|
logging.warning("Midi Channel smaller 0 detected: {}. Limiting to 0. Please fix manually".format(value)) |
|
|
logger.warning("Midi Channel smaller 0 detected: {}. Limiting to 0. Please fix manually".format(value)) |
|
|
return 0 |
|
|
return 0 |
|
|
else: |
|
|
else: |
|
|
return value |
|
|
return value |
|
|