Conversation
Timidity prints verbose console output (internal midi details such as lyrics/text events) to stderr while converting midi to wav, which was previously not capturable. Adds a suppress_midi_output option on ChordExtractor/Chordino (and suppress_output on midi_to_wav) to silence this via stderr redirection.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
midi_to_wavinchord_extractor/converters.py) previously always let Timidity's console output through unfiltered. Timidity writes fairly verbose diagnostic info about the midi file's internals (e.g. track/lyric/text events) to stderr, which was not being captured or suppressible, so it prints straight to the console during conversion.suppress_outputparameter tomidi_to_wav, which redirects Timidity's stderr toDEVNULLwhen set.suppress_midi_outputonChordExtractor.__init__(used inpreprocess) andChordino.__init__, so callers can doChordino(suppress_midi_output=True)to silence the conversion noise.suppress_midi_output=False) to avoid any breaking change for existing consumers.Test plan
tests/test_converters.pycovering thatsuppress_output=Truepassesstderr=DEVNULLto the Timidity subprocess call, and that the default leaves stderr untouched (mockssubprocess.run, so no Timidity binary needed).python -m pytest tests/test_converters.py -vflake8 . --count --select=E9,F63,F7,F82 --show-source --statistics(no new issues; also fixed a pre-existing long-line warning on the touched line)tests/test_chordino.py::test_extract_many(requires Timidity binary + Chordino native lib, not available in this sandbox — behavior unaffected since new option defaults to off)🤖 Generated with Claude Code