lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A twelve tone matrix engraver


From: Urs Liska
Subject: Re: A twelve tone matrix engraver
Date: Sat, 2 Jan 2016 18:52:36 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0

Hi,

unfortunately I have only *very* limited time right now, but this looks absolutely great!

Just one minor suggestion: I'd insert
    \accidentalStyle dodecaphonic
in the \layout block.

I think this would be an extremely nice topic for a post on Scores of Beauty, if you'd like to write one.

Best
Urs

Am 02.01.2016 um 18:09 schrieb Caio Giovaneti de Barros:
Hi!

I've been working on a automatic way to engrave a 12 tone row matrix in Lilypond (See, for instance, http://unitus.org/FULL/12tone.pdf for an explanation of what it is). I'm doing it as a project to teach myself Scheme. I wanted to have something concrete to work with wile learning and create something useful at the same time.

There are some websites and softwares that already generate this kind of matrix:
http://composertools.com/Tools/matrix/MatrixCalc.html
http://in.music.sc.edu/fs/bain/software/tta-v2.22d/default.htm
http://www.musictheory.net/calculators/matrix

but I don't know any that outputs proper engraved sheet music, which would be very convenient for me. I any case the point is not to create something new, but to have some project that would require me to learn Scheme and be useful.

It's being a very interesting experience, sometimes fun, sometimes frustrating, a lot of times obsessive, but I finally arrived at something which I'm satisfied and wanted to share. So here it is! Just put all files in the same directory and run 12tone-matrix.ly to see what it looks like. All criticisms and suggestions are very much appreciated.

You can read all the 12 transpositions and inversions of the rows. For the retrogrades, just read it from right to left. The inversions are read vertically, delimited by the dashed lines, and retrograde-inversion is read from bottom to top. I'll explain some (nasty) details in the following lines.

-------

I found it easier to separate the pure scheme calculations in one file and the lilypond specific variables in another one (these correspond to 12tone-calc.scm and 12tone-engravers.ily as you may gess). This would allow me possibly to use the same Scheme functions with other software, although lilypond requires placing a # before each scheme function, which make the task a little harder.

I tried to start building some very generic and abstract pitch calculations and define functions progressively more specific, so I can expand the code more easily and possibly experiment with other types or pitch sets or even other musical parameters like durations, etc. That's why I have a different concept of an inversion and an inversion for 12 tone rows, for instance. I will not go into details of how the calculations work since I think it's not appropriate to this list, maybe I'll do it in the future in another place. What is interesting is that in the process I had to learn and apply the concepts of higher-order functions and recursion which are very convenient in Scheme.

The engravers were interesting. Since I was basically going to engrave 12 rows which are equal in all aspects except the pitches I wanted to create some function that would create a new staff with some specific configurations and recursively call itself 12 times. The Scheme tutorial by Urs Liska (lilypondblog.org/category/using-lilypond/advanced/scheme-tutorials/) was very useful, I had a hard time trying to imagine how I could do it with "the Lilypond way" of defining functions, but with the help of the tutorial I was able to arrive at something that works, although I'm not 100% satisfied with it yet.

I have the code being controlled by git (another thanks to the lilypond blog for showing me the importance of learning git and have version control) but it is not published yet since it is mainly a personal project, I may do it in the next days, though.

Enjoy! And please send me some feedback.
Caio Barros


_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user


reply via email to

[Prev in Thread] Current Thread [Next in Thread]