Generating Musical Phrases
After years of fiddling with algorithmic composition, I have come to reach for certain tools to craft melodies, bass-lines, solos, etc. My latest generative composition program and output will illustrate...
The program in question is quasi-random-durations
The code libraries that I love to use so much are:
- Data::Dumper::Compact - For concisely displaying the data structures that embody programmed musical things.
- MIDI::Drummer::Tiny - For adding beats to my projects.
- Music::Duration::Partition - For generating quasi-random rhythmic phrases in a given duration.
- Music::Scales - For providing the scale notes that are the atoms of music.
- Music::VoiceGen - For generating a smooth series of pitches.
(A couple are written by me, because they didn't exist yet!)
Here is the output of the program imported into my DAW, tweaked and enhanced. The keyboards and bass were generated by selecting the "better" bits after many runs. Also: it is an an odd time signature: 5/4, then 3/4, then 5/4 again.