News for hackers. Stuff that matters.
Re:Compositional Music Composition by kragen on Thursday March 05, 2015 @02:33PM (#9153250)
This is pretty similar to the way synthgramelodia (http://canonical.org/~kragen/sw/aspmisc/synthgramelodia.py, although git cloning that directory is probably the easiest way to download it) composes its stochastic music (http://canonical.org/~kragen/sw/synthgramelodia/). I did it in Python and didn’t use operator overloading for the combiners, in part because the melodies are stochastically composed DAGs rather than manually-composed.

It has the same primitive melodies of a rest and a note, and also the concatenation and concurrent ways of combining them, but with some additional details which make a big difference:

0. Primitive notes and rests are all the same length and (for notes) pitch and volume — one beat, A2, and 0dB; to get other pitches, lengths, and volumes, you have to use combining forms.

1. Concatenation and concurrency adjust the lengths of the combined melodies to be equal, so that the duration of a melody is necessarily a power of two. At different times I've done this by different combinations of repeating the shorter one, speeding up the longer one, and slowing down the shorter one. Currently the code repeats the shorter one in all cases, but I think this doesn’t work as well as some of the previous combinations I’ve tried.

2. Concatenation drops the volume of the second half of the resulting melody by 2dB, resulting in a sort of fractal loudness contour with clearly defined measures.

3. Concurrency raises the pitch of one of the melodies by an octave, so that you tend to have similar motifs in different octaves.

4. There are also Transpose and Louder combining forms, which make all the notes reachable. Transpose drops the pitch of a melody by a perfect fifth, while Louder raises its volume by 3dB.

Synthgramelodia needs a lot of work, but as you can see from the oggs I randomly dumped in that directory years ago, it has already produced some things that are kind of listenable. One problem it has is that it tends to produce scores with very large numbers of inaudibly quiet notes in them, and then it does nearest-neighbor resampling in interpreted Python, so it runs very slowly.

There are no comments on this comment yet.