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

.midi Export #4319

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

.midi Export #4319

wants to merge 15 commits into from

Conversation

Commanderk3
Copy link
Contributor

@Commanderk3 Commanderk3 commented Jan 28, 2025

To export .midi this PR uses the library tones/midi.

@Commanderk3
Copy link
Contributor Author

I am close to completing this feature 👍

@Commanderk3
Copy link
Contributor Author

Commanderk3 commented Feb 1, 2025

fixes:#4311

@pikurasa I think the PR is ready for review. Please check it. Next, I have to work on adding instruments to the MIDI file. After exporting, you can play the MIDI file in media players like Windows Media Player. Right now, it will only play on the piano.
Just like Lilypond the notes have to be in a Start block. Each Start blocks are considered as "tracks" in midi. If you import it in a DAW you can edit it as well.

@Commanderk3 Commanderk3 mentioned this pull request Feb 1, 2025
4 tasks
@Commanderk3 Commanderk3 marked this pull request as ready for review February 8, 2025 08:17
@Commanderk3
Copy link
Contributor Author

Commanderk3 commented Feb 8, 2025

@pikurasa The midi export is finally done. Please review this PR.
@walterbender I made a tune and exported it to FL studio. It is working well. Although my windows player does not seem to understand the instrument. But it works fine with others.

final.mp4

For testing we can use : https://pianotify.com/import-midi-file

@pikurasa
Copy link
Collaborator

I tested https://github.com/sugarlabs/musicblocks/blob/master/examples/Holly-Jolly-Christmas.html, and the output seems to get off track after the third note.

This is the MIDI file generated while on your branch, HEAD is now at d343fd1f4 bug fix:
Christmas.zip

@Commanderk3
Copy link
Contributor Author

@pikurasa, I have fixed the issue. I thought _midiData was filled instantly, but that is not the case. It takes some time to retrieve all the data. Like Lilypond and others, I have created an after-save function to generate a MIDI file when midi data is filled.

Here is the result :->

midi2.mp4

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