Browse Source

more logging

master
Nils 5 years ago
parent
commit
2a47da60b9
  1. 8
      template/engine/pitch.py

8
template/engine/pitch.py

@ -330,10 +330,10 @@ pillarOfFifth = [
def midiPitchLimiter(pitch, transpose):
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
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
else:
return pitch + transpose
@ -341,10 +341,10 @@ def midiPitchLimiter(pitch, transpose):
def midiChannelLimiter(value):
"""makes sure that a midi channel is in range 0-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
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
else:
return value

Loading…
Cancel
Save