Skip to content

Conversation

@emmathesaw
Copy link

@emmathesaw emmathesaw commented Dec 9, 2024

This PR addresses a visual pitch discrepancy in Basic Pitch's piano canvas compared to the exported MIDI files. A pitch offset correction was added to the note creation process, attempting to align displayed and exported pitches while maintaining their accuracy of the transcription.

This is referencing #147

Copy link

@mgodave mgodave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Altogether this looks good. I would encourage you to add some tests to test that the correction works as expected. I would be especially interested to see if the int coercion works as expected.


#apply the correction offset to align pitch (created corrected_notes instead of estimated notes)
corrected_notes = [
(note[0], note[1], int(note[2] - pitch_offset_correction), note[3], note[4])
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the implication of this cast to int? My understanding is that this truncates the decimal portion of the result, is this the desired behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants