2.5.17

'Folk' Tune 'Arrangements'

Standing on the shoulders of giants such as Bartok or Berio, I recently finished writing an ensemble piece title Bastard Tunes. The piece was composed with the help of a machine learning system trained on transcriptions of Celtic music. The system produces short melodies that share many characteristics with the style it learned. But, with the possible exception of the fourth Bastard Tune, my piece applies more freedom in the way the system's output is used as compositional material. The piece will be premiered in a concert with other examples of music composed by and with computers.


At this moment, working with the system is through a python script:
> python sample_rnn.py metadata/config5-wrepeats-20160112-222521.pkl --temperature 1.8 --seed "M:4/4 K:Cmin E"
Which, translated into English means (more or less): take a trained model and use it to generate a tune in 4/4 in the key of C minor with the first note E. The result could start with:
M:4/4
K:Cmin
EC=B,>G,F2C=B,|EB,B,_B,EGF_E|E2(3DCB,C2c=B|GcBGFG_EC|(3E=B,C(3DG^F,D2_C=B,|
[CC]3/2=B,G,=B,E[E=B]=BC|CEdGc<B|1efd_GB>FF=E:|


I can then either decide that I like it and keep it or change some of the numbers in the command and regenerate a different outcome. For example I can change the opening note(s)
 > python sample_rnn.py metadata/config5-wrepeats-20160112-222521.pkl --temperature 1.8 --seed "M:4/4 K:Cmin D E /2 C"
Or I can decide to try again with different temperature. Lower temperature would mean a more 'conservative' sampling form the system (the next note in each step is more likely to be the most probable one). Higher temperature will result in more adventurous results.
Both the way I extracted the material from the system through such an interactive process and how this material was transformed in the composition process is different in each of the four movements of Bastard Tunes. For example, this is part of a melody I got through the system:
Which was the basis for this page from the second movement:

Throughout that movement the melody generated with the system is at the centre surrounded by heterophonic textures that at times accompany and at times contrast with it. I also used the melody itself with considerable freedom - removing bars or phrases that didn't work, changing rhythms to make it less rigid, octave transpositions, etc. 
I took a slightly different route in the first movement. I wanted four melodic strands that start together and gradually diverged. It took several experiments with the system till I got what I wanted. I started by setting the temperature parameter very low which meant the next note in the melody would often be the most likely note. I got 4 very similar melodies:
 Using the last measure of each tune as the seed and gradually raising the temperature parameter, I got melodies that gradually diverged from each other
 And also got further and further away from the training style:
 There was still a fair bit of further editing on my part (removing very large portion at the end - I generated too much material; changing octaves to fit the instruments and bring out interesting bits; deleting some notes so the players can breath; etc.) to make it really work.
 
My colleague and collaborator Bob posted the score of a piece he wrote with the same system on his blog.
 

No comments:

Post a Comment