Professional Documents
Culture Documents
Computing With Chord Spaces
Computing With Chord Spaces
net/publication/281557608
CITATIONS READS
6 93
2 authors, including:
Donya Quick
Stevens Institute of Technology
20 PUBLICATIONS 79 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Donya Quick on 07 September 2015.
Theorem 2. If relations R1 and R2 have normalizations f1 The point h0, 5, 7i should, therefore, be normalized to
and f2 , respectively, with ranges S1 and S2 , respectively, h0, 2, 7i under the conventions of our representative sub-
such that S1 ∩ S2 6= 0,/ then if f3 = f1 · f2 has the range set. However, we cannot use any of the normalizations
S3 = S1 ∩ S2 , then f3 is a normalization for R1 ∨ R2 . discussed so far to accomplish this. h0, 5, 7i will be mapped
to itself with normP, normO, and normT . The same thing
Proof. From definition 1, S1 and S2 are representative sub- happens with h0, 2, 7i as well. Therefore, we have two
sets for R1 and R2 respectively. Every point in a represen- choices: create one or more new normalizations, or use
tative subset for some relation R belongs to a different R- another algorithm to test whether two chords are OPT -
equivalence class. When applying additional equivalence equivalent.
relations to a set, the number of equivalence classes can We have chosen to use another algorithm that, although
never increase. If an element is in S1 − S2 , it must be R2 - makes use of the O, P, and T normalizations, does not
equivalent to an element in S1 ∩ S2 . Similarly, elements define a normalization for the OPT relation itself. This
in S2 − S1 must be R1 -equivalent to elements in S1 ∩ S2 . algorithm returns true if and only if two chords are OPT -
S3 is therefore the only set of points which are not R1 R2 - equivalent.
equivalent to each other. Therefore, every point outside
of S1 ∩ S2 will map to only one point in S3 , meeting the Algorithm 5. optEq(~x,~y) =
requirements for f3 to be a normalization and S3 to be a
1. Let ~x0 = normOP(~x), ~y0 = normOP(~y).
representative subset for R1 R2 .
2. Let S~y = {normPT (~y + 12~i) |~i ∈ [0, 1]n ∧~i 6= 1n }.
Corollary 2. The function normOT = normO · normT is
a normalization for Zn /OT . 3. If ~x0 ∈ S~y then return true, otherwise return false.
Proof. Recall that ~x ∼OT ~y ←→~x =~y + 12~i + c~1. Two chords are OPT -equivalent if some stacking of
• normT ’s range is ST 1 = {h0, x2 , ..., xn i ∈ Zn }. their pitch classes have the same multiset of intervals. S~y
includes all possible sorted intervallic structures of~y’s pitch
• normO’s range is SO = [0, 11]n . classes. We have that ~x0 ∈ [0, 11]n , ~x0 is sorted, and S~y in-
cludes all sorted, OPT -equivalent vectors to ~y within the
• normOT ’s range is SOT = {h0, x2 , ..., xn i ∈ [0, 11]n }. range [0, 11]n . Therefore ~x0 ∈ S~y ←→~x ∼OPT ~y.
SOT = SO ∩ ST 1 , therefore normOT is a normalization for
OT . 3. GENERATING CHORD PROGRESSIONS
Corollary 3. Algorithm 3, normOP, is a normalization Finding a normalization for a chord space is important
for OP-space. because it is one way to determine which chords belong
to the same equivalence class. Many progressions will
Proof. share the same pattern of representative points when their
chords are normalized, so the process of rewriting har-
• normO’s range is [0, 11]n .
mony for n voices using chord spaces can be modeled as
• normP’s range is SP = {~x ∈ Zn |~x = sort(~x)} a three-step process:
• normOP’s range is SOP = {~x ∈ [0, 11]n |~x = sort(~x)} 1. Normalizing the chords in the original progression
to find a path through the representative subset of
SOP = [0, 11]n ∩ SP , therefore normOP is a normalization Zn /R.
for OP.
2. Generating all solutions that share the same normal-
A normalization also exists for PT : ized path.
Algorithm 4. normPT = normT · normP 3. Choosing a solution with the desired characteristics.
In the case of our example for three tenors, R would be 3.2. Algorithms for Applying Predicates
OP and the desired characteristics would include specific
Finding a chord progression satisfying certain predicates
ranges for each voice.
is analogous to the satisfiability problem in computer sci-
A sequence of equivalence classes represents many
ence, which is NP-complete for arbitrary formulas on
possible concrete progressions, each with a unique path
Boolean variables [7]. Because of this, there is a tractabil-
through Zn . In OP-space, choosing the specific shape of
ity issue involved in finding candidate solutions that sat-
the path through a series of equivalence classes is anal-
isfy one or more potentially arbitrary predicates. If there
ogous to choosing a voice-leading behavior. For a chord
are k possible choices for each of m chords in a progres-
space, Zn /R and a sequence of concrete chords,
sion, there are km total possibilities. For a given quotient
X = [~x0 , ...,~xm ],~xi ∈ Zn , the set of chord progressions shar-
space S/R and predicate H we clearly need a more effi-
ing the same sequence of equivalence classes as X is:
cient method for finding solutions than generating all R-
{[~y0 , ...,~ym ] |~yi ∈ E(~xi , Zn /R)} (4) equivalent solutions, storing them, and then looking for
cases satisfying H. An algorithm generating H-acceptable
We can further constrain this to some subset of Zn , limit- solutions must perform more aggressive pruning of the so-
ing the range of each voice based on instrumental or per- lution space.
former constraints. One way to prune the solution space is through the
use of predicates that operate on sub-progressions, such
{[~y0 , ...,~ym ] |~yi ∈ E(~xi , S/R), S ⊆ Zn } (5) as pairwise predicates. An algorithm can apply the pred-
icates while generating partial solutions. We present one
Finally, we want solutions that exhibit desirable behav- such algorithm below for pairwise predicates. While this
ior, such as those having certain voice-leading characteris- general strategy does not change the complexity class of
tics (e.g. smooth voice-leadings, no voice crossings, etc.). the problem, it avoids computing and storing unnecessary
Given a musical predicate, H, that defines what desirable progressions.
behavior is for a chord progression, we can further narrow
the set of candidate solutions: Algorithm 6. pairProg(R, S, h pair , [~
x1 , ..., x~m ]) =
1. If m = 1, return E(~x1 , S/R) = {~z |~z ∈ S ∧~z ∼R ~x},
y1 , ..., y~m ] |~yi ∈ E(~xi , S/R), S ⊆ Zn ∧ H([~
{[~ y1 , ..., y~m ])}
otherwise continue.
(6)
2. Let Y = pairProg(R, S, h pair , [~
x2 , ..., x~m ])
3.1. Musical Predicates
3. Return {[~ y1 , y~2 , ...,~ym ] | y~1 ∈ E(~x1 , S/R),
We define two types of musical predicates: pairwise and y2 , ...,~ym ] ∈ Y, h pair (~
[~ y1 , y~2 )}.
progression predicates. Pairwise predicates apply to pairs
of chords, and progression predicates apply to a sequence, Even when solutions are filtered using predicates, the
or progression of m chords. work involved in traversing the entire set of solutions to
First we define a pairwise predicate that rejects cases locate desirable ones and even the number of desirable
where voice crossing occurs. When voices cross, a per- solutions can be intractable in situations involving many
mutation that sorts one chord’s voices will not correctly chords, many voices, and/or large ranges for the voices.
sort the other chord’s voices. Fortunately, in music, rules are not always strict, and so
it may be sufficient to find a solution that mostly satis-
hnoCross (~x,~y) = fies a set of predicates, even if some parts of the solution
(7)
∃σ ∈ Sn | σ (~x) = sort(~x) ∧ σ (~y) = sort(~y) violate the predicates. We present an alternative, greedy
algorithm for generating chord progressions that, while
Similarly, we define pairwise predicates for avoiding not guaranteed to find a solution satisfying a progression
parallel motion (when two voices move in the same direc- predicate, will attempt to satisfy a pairwise predicate when
tion by the same amount) and for limiting the maximum choosing each chord.
movement of each voice.
Algorithm 7. Let ~xi be the chord for which we wish to
hnoPar (hx1 , ..., xn i, hy1 , ..., yn i) = find a new R-equivalent member of S ⊂ Zn , ~yi . Let ~yi−1 be
(8)
∀i, j ∈ [1, n], i 6= j, yi − xi 6= y j − x j the previously chosen chord, choose(S0 ) be a function to
stochastically select an element from a set, and
hmaxDist (t, hx1 , ..., xn i, hy1 , ..., yn i) = f (~xi ,~yi−1 , E(~xi , S/R)) be a fall-back method for choosing
(9) ~yi .
∀xi , yi , | yi − xi | ≤ t
Finally, given a pairwise predicate, h pair , a progres- greedyChord(~xi ,~yi−1 , S ⊆ Zn , R, H pair , f ) =
sion predicate can be created from it.
1. Let SH = {~y ∈ E(~xi , S/R) | H pair (~yi−1 ,~y)}
m−1
^
h prog (h pair , [~
x1 , ..., x~m ]) = h pair (~xi , x~i+1 ) (10) 2. If SH = 0/ then return ~yi = f (~xi ,~yi−1 , E(~xi , S/R)).
i=1 Otherwise, return ~yi = choose(SH ).
Algorithm 8. Our results show potential as a framework for some
greedyProg([~x1 , ...,~xm ], S ⊆ Zn , R, H pair , f ) = [~y1 , ...,~ym ], tasks in automated composition. We control specific so-
where lution choice with the use of predicates and we use chord
( spaces as a way to organize the solution space at differ-
choose(E(~x1 , S/R)) for i = 1 ent levels of abstraction. Our results also highlight several
~yi =
greedyChord(~xi ,~yi−1 , S, R, H pair , f ) otherwise important issues in the representation of chord spaces for
compositional tasks as well as problems with the tractabil-
The main advantage to this approach is that the so- ity of searching a particular solution space under a set of
lution space is maximally pruned at each step. This al- predicates.
lows the algorithm to operate on inputs that would cause We present sample results using a three-voice input
tractability problems for pairProg. The downside is that progression created by the authors, shown in Figure 1.
greedyProg is not guaranteed to find predicate-satisfying This chord progression is then re-written using our al-
solutions. It is possible to find a partial solution with no gorithms and two different chord spaces: OP-space and
subsequent choices that satisfy the supplied predicate. In OPT -space. The examples make use of the following
such a situation, there are three options: fail and return predicates:
an error message, backtrack to try to find a better solution
(analogous to lazy evaluation of pairProg), or try another • hnoCross (~a,~b) = true iff no voice crossing occurs be-
predicate. For our implementation, we chose the latter: tween ~a and ~b.
a fall-back method for choosing a next chord is therefore
• hnoPar (~a,~b) = true iff no parallel motion occurs be-
required if we wish to ensure that greedyProg produces a
solution. In practice, it may be sufficient to have a result tween any pair of voices in ~a and ~b.
that mostly satisfies a predicate even if some chord tran-
• hmax7 (~a,~b) = true iff no voice moves more than 7
sitions do not. Since this greedy approach does not re-
quire examining all possible solutions, it presents a more halfsteps from ~a to ~b.
tractable option for larger-scale composition problems.
• hall (~a,~b) =
hnoCross (~a,~b) ∧ hnoPar (~a,~b) ∧ hmax7 (~a,~b)
3.3. Moving Between Levels of Abstraction
• hallProg (p) = h prog (hall , p)
Problems of solution space size mentioned so far are more
prominent for chord spaces with very large equivalence For the three-voice progression in Figure 1, two OP-
classes. For example, a given equivalence class in OP- equivalent and two OPT -equivalent progressions are shown.
space can be larger than in O-space. Similarly, OPT -space Figures 2, 3, and 5 utilize the range of [36,57] for each
will have some larger classes than OP-space. However, voice. Figure 4 uses a representative subset of OP-space
before generating a final solution, we can move between instead. For the sake of score readability, we chose to use
levels of abstraction using only representative subsets at a version of this progression transposed up by 48 halfsteps
intermediate steps. to lie within [48, 59]3 rather than [0, 11]3 .
For example, it would be possible to find a path through
a representative subset of OPT space using predicates on 4.1. Greedy Algorithm Performance
chord quality and then, in a second step, transform that
abstract path into one through Zn /OP with predicates to Using the same input progression, hall , and greedyProg,
shape the voice-leadings. If we were to try to find so- we ran an experiment to estimate the success rate of
lutions in OPT -space directly using a predicate for both greedyProg. This progression demonstrates the tractabil-
chord quality and voice-leading behavior, the number of ity issues associated with the general problem of rewrit-
initial possibilities to explore would be much larger. ing chord progressions. There are 11 chords in the input
progression, and, within the range [36, 57]3 , there are 24
OP-equivalent ways to choose each of the first, second,
4. APPLICATION TO VOICE-LEADING
and third chords and 48 ways to choose each of the re-
maining eight chords. This gives a total of 243 488 possi-
We implemented the algorithms described in the previ-
ble OP-equivalent solutions. Of those solutions, we used
ous sections using Haskell, a lazy programming language
pairProg to determine that 901728 of them satisfy hallProg
that allows for a concise and elegant implementation.1
within the range [36, 57]n .
We present examples relevant to our originally described
We ran 10000 trials with greedyProg to find OP-
problem: re-writing existing chord progressions. Dura-
equivalent solutions to the input progression in Figure 1
tions of chords shown in the examples do not change,
within the range [36, 57]3 . We used hmax7 as a fall-back
since our algorithms only make decisions about the as-
method for greedyProg. Under these conditions, 8165
signment of pitches to voices (not duration).
of greedyProg’s returned progressions satisfied hallProg .
1 Our implementation is available at the Yale Haskell Group website, 7406 of those hallProg -satisfying progressions were unique
http://haskell.cs.yale.edu/. solutions. Of the 1835 returned progressions that violated
hallProg , an average of only 1.1 chord transitions per pro- musical set of pitch classes as labels, but the same system
gression violated hall , with the highest number of hall - can be generalized to make choices about more than just
violating transitions being 2. We feel that greedyProg per- pitch class. Unfortunately, in our examples, OPT -space
formed well in this experiment. However, the algorithm’s is too generalized to imitate the types of pitch class de-
performance will be directly affected by the range of the cisions humans might make, because the labels are only
voices and specific predicate used. Decreasing the range an indicator of chord quality. Ultimately, spaces with a
of each voice, for example, would increase the odds that level of generality somewhere between OP- and OPT -
greedyProg would become stuck and rely on its fall-back space may be most useful, giving an intermediate number
function. of equivalence classes. For example, in a particular mu-
sical context, two OP classes may be functionally equiva-
4 lent and therefore could be merged. Finding more appro-
priate, intermediate levels of abstraction may also require
4 more complex spaces, with points holding more informa-
4 tion than just pitches, such as home key. Additionally, this
framework may benefit for including additional concepts
such as Morris’s contour spaces for representing musical
Figure 1. A simple chord progression for three voices. features more diverse than just chords [9].
4 4
4 4
4 4
Figure 4. A solution generated with greedyProg with
an always-true predicate and a transposed version of
Figure 2. A solution generated with greedyProg using
SOP /OPT (4 octaves higher for readability)
[36, 57]3 /OP, figure 1’s progression as input, and hall .