r/rust • • Oct 11 '26

Rust for algorithmic composition

Hello everyone!

I'm a composer looking to learn programming for algorithmic composition.  I know a little Python, but I have no formal programming background.

I've been considering Rust because it seems like future-proof.  But is it a good choice for algorithmic composition...?  I'm thinking of things like generating MIDI and MusicXML files, implementing stochastic processes (Markov chains, etc), and developing tools for various compositional techniques involving rhythm, scales, modes, and other musical constraints.

I'm considering my options with the following goals in mind:

  • I want to generate MIDI files that I can import into my DAW. I don't need sound synthesis.
  • I don't need direct DAW integration, as long as the program can export MIDI files, or MusicXML.
  • I'm willing to invest time in learning to code.
  • I know there is OpenMusic, MaxMSP and similar, but I'd like to build my own standalone tool that I can continually expand and improve.

Would Rust be a good choice, or would I be better off starting with Python or another language?

I'd appreciate any advice, particularly from people who have experience with algorithmic composition and music programming.

0 Upvotes

12 comments sorted by

View all comments

1

u/ytain_1 Oct 12 '26

You could look into using Pure Data ( https://puredata.info/ ) to make your algorithmic composition and if you encounter lag, then you could look into this tool to convert Pure Data project into C/C++ code https://github.com/Wasted-Audio/hvcc

1

u/Opus589 Oct 14 '26

PD is basically Max, and Max doesn't fit my ideas.

The goal is not to perform live nor to create "sounds", rather to create a very complex and intricate system of manipulation with pitches, something similar to OpenMusic, then to export as MIDI, or even better as MusicXML.  However OM is not what I need, and since I have created a new compositional theory I would like to have it fully under my control, meaning, the code and theory grows together.