Hello!
I have already had a couple of discussions over the last years with Daniel regarding eventual scripting support and an eventual Lua API. More precisely, I was interested to create an open-source composer’s toolbox that would allow common (and not so common) manipulations, and to “release” that as a Dorico exclusive.
Meanwhile, since complete scripting support is not in 3.5 yet and nowhere near on the roadmap it seems, I decided to start coding this project using the music21 Python library, open-sourced by the MIT (music21: a Toolkit for Computer-Aided Musicology). I find Lua more fun than Python, but what can you do… Music21 can read/write xml files, so it’s possible to use it by exporting xml music from Dorico to be processed and then importing the resulting xml back. I would much rather be able to do it all inside Dorico, for example by selecting some notes, running a script and outputting the result to a new flow, but meanwhile it’s a working solution.
I am including here some examples of what this will be able to do, to get some community feedback (would you be interested in using that, what functions would you like?), and to show Daniel and developers a very concrete example of what an eventual Lua API could allow us to do. Since Python and Lua are honestly quite close, it will be possible to port things over someday.
I decided to name my own library Arvo, as a hommage to Pärt, but, although you can use it to emulate his style quite easily, you can go well beyond. I feel that there are a million tools out there for twelve-tone composition, but almost nothing for composers interested in applying similar techniques to modal/diatonic worlds so common in, for example, film/game music. So far, I have modules planned for:
- transformations - transpositions and inversions in scale space, great for transposing “diatonically” within a pentatonic/octatonic/anything scale; also retrogrades with options such as pitch-only or rhythm-only retrogrades, various augmentations, diminutions, etc.
- minimalism - create various additive or substractive processes, forward/backward, following linear, primes, fibonnacci series, etc.
- tintinnabuli - create t-voices from m-voices
- isorhythm - create isorhythmic constructions from pitch/rhythm rows
Here are two examples of recreating some of Part works through scripts, which makes for good testing purposes.
1. Fratres
I entered the basic melody in Dorico:
Then ran the following script, which generates the complete melody by applying a substractive process, substracting from the middle outward, then creating an inversion around the C# axis. The script then creates a tintinnabuli voice in 2nd position downards, and a parallel voice a 10th below.
The output xml as directly imported back to Dorico, the only thing manually added in Dorico being the correct time signatures.
2. Cantus for Benjamin Britten
Here since the basic material is only a descending a minor scale, it was easy to define it directly in the script, apply the additive process, create an isorhythm with the Half/Quarter alternation, and add the tintinnabuli voice in 1st position below:
The result imported into Dorico, again only adding a 6/4 time signature. It goes on until it reaches the middle C:
There! I will continue the development of this in the coming weeks, properly document modules and functions, and share a beta of this here for Dorico users who would be interested to play with it.
Meanwhile, I would be interested to hear where plans are with scripting support!