Command line MIDI generation

If I wanted to write a little script to algorithmically generate MIDI clips from the command line with a couple of simple arguments as input, and I wanted it to run with the smallest number of dependencies using a language most people already have installed, what would you recommend for language/library choice?

This looked intriguing at first glance, but I’m wide open for any/all suggestions.

1 Like

Aha, I think this is what I was looking for:

1 Like

Geert Bevin made this cool utility: https://github.com/gbevin/SendMIDI

1 Like

Yeah, that’s really cool for interactive testing.

I’m wanting to do algorithmic generation. So, to do that with Geert’s utility, I’d be shell scripting. I’m quite a bit more comfortable in Python, I’m thinking, but I’ll definitely keep Geert’s stuff in the back of my mind.

Ah I see, I assumed “command line” meant something that could be run from a shell.

A python script can be run from a shell. :slight_smile:

@willbenton had a good suggestion of checking out abc or other MIDI DSLs to make generation of simple phrases/melodies quicker/easier. Options are good!

http://abcnotation.com/

1 Like

Ari Russo’s Ruby midi stuff is pretty good and cross platform iirc https://github.com/arirusso

2 Likes

Very nice!

Looks primarily oriented to realtime though? I wasn’t seeing a MIDI file writer…

oooh!

http://web.mit.edu/music21/

a toolkit developed at MIT for computational musicology, music theory, and generative composition. Provides expandable objects and methods for most common theoretical problems. Supports music import via MusicXML, Humdrum/Kern, Musedata, ABC, and MIDI, output via MusicXML, Lilypond, and MIDI, and can easily integrate with notation editors (Finale, Sibelius, or MuseScore) and other audio and DAW software (via MIDI).

2 Likes

Whoah. Where has this been hiding?

1 Like