4 ms·
Show HN: Code music in Python
Write musical patterns in Python that respond to a given song structure and run a simulation that generates a multitrack MIDI file.
I built this because I think applying code to music making is a powerful tool, but I find that most music coding software out there is more focused on experimentation rather than conventional songwriting. This is an attempt at creating something that can reference typical constructs from songwriting, such as the underlying chord progression and timeline of a song.
I also have a github repo that is a thin wrapper around the api that runs the simulation, for anyone interested in coding locally: https://github.com/vegardkd/pattern-composer-library https://github.com/vegardkd/pattern-composer-library
The website is as bare-bones as possible, designed specifically for showcasing the program. There are also some bugs and inconsistencies in the code being run, but I'm publishing it to see how people react.
I'm trying to a find a way that this might appeal to music producers with no coding background by making the syntax as easy to digest as possible.
I would greatly appreciate feedback.
- Rochus 3y agoInteresting approach. There has been much activity in recent years in live coding with a lot of interesting solutions. > most music coding software out there is more focused on experimentation rather than conventional songwriting Did you have a look at e.g. https://github.com/alda-lang/alda https://github.com/alda-lang/alda or https://abcnotation.com/ https://abcnotation.com/? Or e.g. https://github.com/emicklei/melrose https://github.com/emicklei/melrose is a similar approach as yours. There is also an algorithcmic composition language called SAL which is used in Common Music (https://commonmusic.sourceforge.net/ https://commonmusic.sourceforge.net/) and Niquist (https://sourceforge.net/projects/nyquist/ https://sourceforge.net/projects/nyquist/).
- mysterious_oil 3y agoI think I've come across alda and abc notation. I agree melrose seems the most similar to mine. I guess it's an over-generalization saying most software out there is focused on experimentation. I was thinking mostly of Sonic Pi and SuperCollider. I think the main difference in my program is that you'll be defining functions that react to state in the song during the simulation, which can output notes dependent on that state (such as the root of the current chord), instead of concrete notes visible at "compile time".