Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new algo audio2midi #1437

Merged
merged 19 commits into from
Jan 9, 2025
Merged

Conversation

xaviliz
Copy link
Contributor

@xaviliz xaviliz commented Aug 30, 2024

It includes header, cpp and unittests.

@dbogdanov dbogdanov marked this pull request as ready for review October 1, 2024 13:04
Comment on lines 215 to 222
if sys.platform == "darwin":
import soundfile as sf

audio, _ = sf.read(filename, dtype="float32")
if audio.ndim > 1:
audio = audio[:, 0]
else:
audio = MonoLoader(filename=filename, sampleRate=sample_rate)()
Copy link
Member

Choose a reason for hiding this comment

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

Use MonoLoader for both cases for consistency and also to avoid additional dependency.

Copy link
Contributor Author

@xaviliz xaviliz Nov 8, 2024

Choose a reason for hiding this comment

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

Right, but I'm running tests in OSX. So, I need it to run them. Once we resolve all comments I might remove it. Let's fix the other parts and I will do it.

Copy link
Member

Choose a reason for hiding this comment

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

To be able to merge this now, let's get rid of the soundfile dependency and let the test temporarily fail on MacOS.

Comment on lines +44 to +47
n_notes_tolerance: int = 0,
onset_tolerance: float = 0.01,
offset_tolerance: float = 0.01,
midi_note_tolerance: int = 0,
Copy link
Member

Choose a reason for hiding this comment

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

This can be hardcoded inside asserts directly

Copy link
Contributor Author

@xaviliz xaviliz Nov 8, 2024

Choose a reason for hiding this comment

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

No, it cannot because it is inside runARealCase() which receive different values for those parameters. If we hardcoded some tests will fail. I can remove the default value, that would be okay.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please resolve or suggest any others changes.

Comment on lines 215 to 222
if sys.platform == "darwin":
import soundfile as sf

audio, _ = sf.read(filename, dtype="float32")
if audio.ndim > 1:
audio = audio[:, 0]
else:
audio = MonoLoader(filename=filename, sampleRate=sample_rate)()
Copy link
Member

Choose a reason for hiding this comment

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

To be able to merge this now, let's get rid of the soundfile dependency and let the test temporarily fail on MacOS.

@dbogdanov dbogdanov merged commit b8c49d0 into MTG:master Jan 9, 2025
1 of 7 checks passed
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