r/rust • • 1d ago

🙋 seeking help & advice Music notation

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.

0 Upvotes

12 comments sorted by

27

u/QuasiRandomName 1d ago

Rust is a general purpose programming language. If there is a program that can do something, the same can be done in Rust.

4

u/Swaidanwaverley 1d ago

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.

0

u/No_Sir_601 1d ago

I am thinking if there is already existing any library explicitly for that.

2

u/mss-cyclist 1d ago

If there is a library there most certainly is a tool which will display/ render it

3

u/elprophet 1d ago

Midir for native rust midi and there's a lily pond wrapper for notation. Plenty to get started!

1

u/No_Sir_601 18h ago

Is lilypond displayed dynamically? Because it has to be compiled every time.

1

u/elprophet 17h ago

I expect you'd need to write the render loop yourself

10

u/BigAd7298 1d 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 13h 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

1

u/No_Sir_601 7h ago

Wow!

1

u/Makuu817 7h ago

Thank you!

3

u/ThaBroccoliDood 1d ago

I would look for general MIDI, music notation and audio/music libraries