I’m still off topic…and then on it again!

Not added a post for a few days..but I’ve been very busy. Still got the music bug, and I’ve been investigating the musical dice games in the Mozart KV 516f composition(s). Basically you throw two dice and choose bars from a stock of 176 bars using a lookup table. The result, a passable waltz in Mozartian style. Others have been there before, and I started with a python script by Martin Tarenskeen  http://tmp.martintarenskeen.nl This worked very well, but I had a physical copy of the cards given to me in a present a few years ago, and that also had cards to generate a 2/4 time Contredanse. I decided to add this to the original program. It was quite an organisational task to type in all 176 bars of this new version and check them, and then transfer them to a python array for use in the program.

So I got diverted back on to my Mac where I spent a considerable time getting the Frescobaldi GUI front end for lilypond installed and working. Eventually I got this working and it is a great productivity tool. I typed in the bars (left and right hands are stored separately) and checked them, and then transferred the lilypond source for each bar into a spreadsheet and also a filemaker database, where I worked out duplicates, and generated allocation statements for the python array. I then transferred these back to a copy of the original python script, replacing the original array, typed in the new lookup table (supplied with the card game), modified the script for a different time signature, and eventually got it working.

Finally I integrated the two scripts together, with an input argument to enable the user to choose which one to output, the waltz or the contredanse.

At this stage I went back on topic, and transferred the script to my Pi. I had to amend it again slightly, because the original was written for lilypond 2.16.2 (which I have on my Mac) whereas the installed version on the Pi is 2.14.2 Luckily, apart from the version number there was only one further change to make {to the repositioning of the /tempo command, which wouldn’t compile} and it worked on the PI.

Finally, I used some of the techniques employed in the Sounding-Off project to set up a small bash script to compile and run a pair of waltz and contredanse and display them in Netsurf whilst playing the tunes with timidity.

The end result is perhaps a little more sonorous than the 12tone project that preceded it!
The whole operation is also a great example of how to use different software and indeed different platforms to pass around the data you are working on to achieve your end result.

TextWrangler, lilypond, frescobaldi, fluidsynth, qsynth, Excel, FilemakerPro on the Mac, followed by lilypond, convert, timidity, nano, netsurf on the Pi

A sample Contredanse produced by the script on the Pi


And a sample Waltz

I will post the code for the scripts next week, when it is finalised


2 thoughts on “I’m still off topic…and then on it again!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s