I am getting an abundance of music21 warnings about zero-duration chords:
WARNING: midi chord with zero duration will be treated as grace
I tried overwriting the warn
method on music21.environment.Environment()
with the following:
def silence(*args, **kwargs): pass
e = music21.environment.Environment()
setattr(e, 'warn', silence)
I also tried muting all warnings:
import warnings
warnings.filterwarnings('ignore')
Neither has done the trick. How can I mute these (or ideally, all) warnings from music21? (I validate my data post-processing.)