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

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

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
src/algorithms/tonal/audio2midi.cpp Outdated Show resolved Hide resolved
src/algorithms/tonal/audio2midi.cpp Show resolved Hide resolved
src/algorithms/tonal/audio2midi.cpp Outdated Show resolved Hide resolved
src/algorithms/tonal/audio2midi.cpp Outdated Show resolved Hide resolved
src/algorithms/tonal/audio2midi.cpp Outdated Show resolved Hide resolved
test/src/unittests/tonal/test_audio2midi.py Outdated Show resolved Hide resolved
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.

test/src/unittests/tonal/test_audio2midi.py Outdated Show resolved Hide resolved
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.

test/src/unittests/tonal/test_audio2midi.py Outdated Show resolved Hide resolved
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