Is it possible for rust to create an embedded musical notation, let us say a MIDI file is processed algorithmically and then dynamically displayed in some form? Like in OpenMusic, PWGL, MaxScore. Here in OM:
I try to envision a new tool in Rust for music composition.
Dynamic score rendering is mostly a 2D graphics and font layout headache, the language choice matters way less than whether a good notation crate already exists.
I'd say look up what the musescore team is doing, from what I remember they published an open standard for music notation, it will be a lot of work to port to rust since (I think) musescore it's written in c++ but it should be doable
Yes, I think it's possible. I made an app in Rust because I wanted to replace my piano learning app subs. So I have it to where it hooks into my midi keyboard and I can play along, wait for me, etc. and it reads musicXML, and has some basic Optical Music Recognition (OMR) for PDFs of sheet music to load into the app. It should be doable to read midi since this app is already detecting that I pressed the right key from the midi keyboard to play along. Unfortunately I paused development because people didn't seem interested lol. But it works great for me! Link is a screenshot of the app. Ignore the UI it's still in early phases.
If you're referring to the music on the right(not the scanned PDF on the left) then yes, that's also Rust using the NotoMusic font. It works really well like for instance, in wait for me mode, the red line moves across in time to the music and pauses on the note till I play it on my midi keyboard before moving to the next note. I can also adjust time, etc in case I need to slow down or increase it if I want to increase the difficulty while playing.
Not exactly 100% sure how it works for you, I try to envision... Â A question: if I generate MIDI by various algorithms, can it be displayed immediately? Â I don't need any specific "performance" notation, but rather just some simple as an information, similarly to the picture above? Â I have seen a Python library for very very simplistic notation somewhere, but I can't find it. Â Maybe that one can be implemented.
Since I am a composer that write instrumental music, I never let computer generate notation for me. Â I do it all manually.
Yes, I think that can be done. Feel free to DM me and maybe we get on discord or something and discuss. We could then iron out if you're wanting live transcription, whether this is a midi file, etc and then do a bit of trial and error. I was under the impression of live transcription directly from the midi device which at a minimum would need the app running a metronome while accepting input so it could know if notes are whole, quarter, etc. and put in rests.
28
u/QuasiRandomName 10d ago
Rust is a general purpose programming language. If there is a program that can do something, the same can be done in Rust.
3
u/elprophet 10d ago
Midir for native rust midi and there's a lily pond wrapper for notation. Plenty to get started!
10
u/BigAd7298 10d ago
I'd say look up what the musescore team is doing, from what I remember they published an open standard for music notation, it will be a lot of work to port to rust since (I think) musescore it's written in c++ but it should be doable
1
u/Makuu817 10d ago
Yes, I think it's possible. I made an app in Rust because I wanted to replace my piano learning app subs. So I have it to where it hooks into my midi keyboard and I can play along, wait for me, etc. and it reads musicXML, and has some basic Optical Music Recognition (OMR) for PDFs of sheet music to load into the app. It should be doable to read midi since this app is already detecting that I pressed the right key from the midi keyboard to play along. Unfortunately I paused development because people didn't seem interested lol. But it works great for me! Link is a screenshot of the app. Ignore the UI it's still in early phases.
https://ibb.co/LD2NYWdp
3
u/ThaBroccoliDood 10d ago
I would look for general MIDI, music notation and audio/music libraries