Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions basic_pitch/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,9 @@ def predict(
multiple_pitch_bends: If True, allow overlapping notes in midi file to have pitch bends.
melodia_trick: Use the melodia post-processing step.
debug_file: An optional path to output debug data to. Useful for testing/verification.
midi_tempo: The tempo, in BPM, written to the output MIDI file's header. This only sets the
tempo metadata; note start/end times are taken from the audio in absolute seconds and are
not rescaled, so it does not change note timing or playback duration.
Returns:
The model output, midi data and note events from a single prediction
"""
Expand Down Expand Up @@ -544,6 +547,9 @@ def predict_and_save(
melodia_trick: Use the melodia post-processing step.
debug_file: An optional path to output debug data to. Useful for testing/verification.
sonification_samplerate: Sample rate for rendering audio from MIDI.
midi_tempo: The tempo, in BPM, written to the output MIDI file's header. This only sets the
tempo metadata; note start/end times are taken from the audio in absolute seconds and are
not rescaled, so it does not change note timing or playback duration.
"""
for audio_path in audio_path_list:
print("")
Expand Down
4 changes: 4 additions & 0 deletions basic_pitch/note_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ def note_events_to_midi(
multiple_pitch_bends : If True, allow overlapping notes to have pitch bends
Note: this will assign each pitch to its own midi instrument, as midi does not yet
support per-note pitch bends
midi_tempo : The tempo, in BPM, written to the output MIDI file's header via
initial_tempo. This only sets the tempo metadata, while the note start/end times are taken
from the audio in absolute seconds and are not rescaled, so it does not change note timing
or playback duration.

Returns:
pretty_midi.PrettyMIDI() object
Expand Down
4 changes: 3 additions & 1 deletion basic_pitch/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ def main() -> None:
"--midi-tempo",
type=float,
default=120,
help="The tempo for the midi file.",
help="The tempo, in BPM, written to the MIDI file's header. Note: this only sets the tempo "
"metadata and does not change note timing or playback duration, which always follow the "
"original audio.",
)
parser.add_argument(
"--debug-file",
Expand Down