lilypond-user
[Top][All Lists]
Advanced

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

automatic partwriter


From: David Nalesnik
Subject: automatic partwriter
Date: Tue, 26 Sep 2017 21:59:09 -0500

Hi all,

I wanted to share something which I think illustrates the power that
Lily has over other popular notation software.

I spend a lot of time teaching partwriting to undergraduate music
majors, and recently, suddenly, it occurred to me that anything as
rule-bound as correct partwriting (I stress "correct" as opposed to
"artistic" or even "interesting") would naturally be the province of
computers.  A computer should be able to instantly provide all
possible solutions to a problem with so many constraints.

I've attached the beginning of an automatic partwriter.  The highlight
is the output of every possible realization of a simple
progression--given the restrictions I've chosen to apply.  Feel free
to add more.  These restrictions are:

(1) a rather constrained range for the voice parts (a central octave
for upper parts, slightly more for the bass--perhaps suitable to a
beginning or an ending);
(2) all parallel perfect intervals are disallowed;
(3) consecutive fifths/octaves by contrary motion are disallowed;
(3) approach to perfect fifths and octaves in outer voices by similar
motion is disallowed unless the soprano moves by step ("direct fifths
and octaves");  I'm aware that other practices may be more
severe--easy to incorporate stricter requirements.  (See how I deal
with parallels.)
(4) voice parts may not cross or overlap.
(5) adjacent upper voices may never be more than an octave apart;
(6) certain intervals are disallowed (I do allow the diminished 5th
for the sake of the lovely fa-ti-do in the example progression);
(7) the bass is prevented from leaping over an octave (never thought
of this until I saw preliminary output);
(8) all chords are complete;
(9) the root is doubled.
(10) the leading tone must resolve to tonic unless it is in an inner
voice, when it may drop to the dominant pitch.

You will notice that among the great number of possibilities spewed
forth are a number which aren't great.  Further processing could weed
out variants which (for example): (1) move all parts in similar
motion; (2) are excessively "leapy"; (3) don't follow leaps with
stepwise motion in the opposite direction; (4) arpeggiate quartal
harmony (!); etc.  A ranking could be assigned to lines based on their
"arch-like" contour, their ratio of stepwise motion to skips and leaps
(as Lily gives scores to possible slur shapes to arrive at the best
realization); whatever.

What this does not do yet:
(1) accommodate variable doublings (as usual with first-inversion
triads; also, the "Pachelbel canon progression"--Heaven forfend--won't
return any results as there is no possible realization with the
parameters I've specified);
(2) handle leading tones outside of dominant harmony;
(3) resolve chord sevenths properly;
(4) have a necessary sense of _chord function_
(5) A whole host of things.

As far as applications, It strikes me that this could be useful as a
generator of examples for ear training exercises (as well as a
generator of possibilities for evaluation, and a generator of
everything which may be done given certain constraints--among positive
applications :) )

The attached file demonstrates
(1) every possible realization of the progression vi-ii-V-I (B major)
and i-iv-V-i (c minor) with certain constraints (change the range
variable to see a _huge_ increase of possibilities);
(2) a random realization (we dispense with the "all-possibilities"
approach here--there is the danger of a dead end);
(3) all possible voicings of a seventh chord (with constraints attached).

One possible flaw is the way that I generate possible realizations.
Basically, I look for all possible rule-obeying two-chord pairings
between chords 1 and 2, then find all possible connections between
chords 2 and 3 which dovetail with the found connections between 1 and
2, and so forth.  It's easy to see that this could lead to an overflow
with a long progression or if there aren't plenty of rules to weed out
as many branches of the tree as possible before they have the chance
to propagate,  A truly artful solution would mimic the thought process
of a intelligent human being, but I'm aware that this is quite quite a
bit more difficult than the sledge-hammer approach I've taken.

Anyway, sorry to go on so long.  FWIW...

Comments welcome!

Best,

David

Attachment: partwriter7.ly
Description: Text Data


reply via email to

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