Skip to content

Commit a019e48

Browse files
Merge pull request #97 from spotify/dohertyg/inconsistent-minimum-note-length
Fix Inconsistent Minimum Note Length
2 parents 4855f26 + 7e2b268 commit a019e48

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

basic_pitch/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import pathlib
1919

2020
__author__ = "Spotify"
21-
__version__ = "0.2.6"
21+
__version__ = "0.3.0"
2222
__email__ = "basic-pitch@spotify.com"
2323
__demowebsite__ = "https://basicpitch.io"
2424
__description__ = "Basic Pitch, a lightweight yet powerful audio-to-MIDI converter with pitch bend detection."

basic_pitch/inference.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ def predict_and_save(
351351
model_path: Union[pathlib.Path, str] = ICASSP_2022_MODEL_PATH,
352352
onset_threshold: float = 0.5,
353353
frame_threshold: float = 0.3,
354-
minimum_note_length: float = 58,
354+
minimum_note_length: float = 127.70,
355355
minimum_frequency: Optional[float] = None,
356356
maximum_frequency: Optional[float] = None,
357357
multiple_pitch_bends: bool = False,
@@ -372,7 +372,7 @@ def predict_and_save(
372372
model_path: Path to load the Keras saved model from. Can be local or on GCS.
373373
onset_threshold: Minimum energy required for an onset to be considered present.
374374
frame_threshold: Minimum energy requirement for a frame to be considered present.
375-
minimum_note_length: The minimum allowed note length in frames.
375+
minimum_note_length: The minimum allowed note length in milliseconds.
376376
minimum_freq: Minimum allowed output frequency, in Hz. If None, all frequencies are used.
377377
maximum_freq: Maximum allowed output frequency, in Hz. If None, all frequencies are used.
378378
multiple_pitch_bends: If True, allow overlapping notes in midi file to have pitch bends.

basic_pitch/note_creation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def model_output_to_notes(
4848
onset_thresh: float,
4949
frame_thresh: float,
5050
infer_onsets: bool = True,
51-
min_note_len: int = 5,
51+
min_note_len: int = 11,
5252
min_freq: Optional[float] = None,
5353
max_freq: Optional[float] = None,
5454
include_pitch_bends: bool = True,

basic_pitch/predict.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def main() -> None:
7373
parser.add_argument(
7474
"--minimum-note-length",
7575
type=float,
76-
default=58,
76+
default=127.70,
7777
help="The minimum allowed note length, in miliseconds.",
7878
)
7979
parser.add_argument(

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.2.6
2+
current_version = 0.3.0
33
commit = True
44
tag = True
55

0 commit comments

Comments
 (0)