“Algorithms for Chordal Analysis”

“Algorithms for
Chordal Analysis”
Original Paper by Bryan Pardo and
William P. Birmingham
Presentation By Samuel Woo
Chordal Analysis
• Important to the computer research of music
• Allows automated manipulation of music
• Previous work in Chordal Analysis
– Unclear about segmentation
– Provided no metric or measurement of accuracy
• Pardo and Birmingham’s system is
– Simple and easily reproducible
– Basic first try at generating a system
– Provides a baseline standard for accuracy
Overview of Method
• Uses two interdependent “parts”
– Segmentation
– Segment (chord) labeling
• Segmentation is breaking the musical piece into
individual segments
– These represent the chords of the piece
– The best segments match chord templates very well
• Segment labeling determines the type of chord
– Determines both root pitch and quality
– Also measures how well segment fits chord templates
Segmentation I
• The first task is the partition the music into areas
where a distinct combination of pitches are being
played
• Partitions occur where a note starts and a note stops
– When a note starts the new combination of pitches being
played adds the new note
– When a note stop the combination of pitches being played
looses the note
• Segments begin and end on each partition
• Minimal segments occur between consecutive
partitions
Partitioning Example
Musical Piece
Note start and end
Minimal segments and
indication of notes being
sounded
Chord Templates
• Chords represented by a root and a tuple
• Simplified to a set of templates
– Uses pitch class numbers (0 through 11) to represent
templates
– Pitch # 0 represents C
• Not all tuples used in this analysis
– 72 Templates used from 6 tuples across all 12 root pitches
Table 2 from “Algorithms for Chordal Analysis” Showing which tuples where used in the system
Scoring a Segment
• Each note in a segment is given a weight
– Weight determined by how many minimal segments a
note can be heard in
– Does not consider note length or amplitude
• For each template calculate a score
– Add the weight of a note to the score if it matches a
pitch in the template
– Subtract the weight of a note from the score if it does
not match a pitch in the template
– Subtract one from the score for each template pitch
that is missed by (not present in) the segment
Scoring
• For each segment a score is calculated for every
template
• Highest scoring template determines the label of
the segment
• There can be ties and a tie breaking scheme must
be used to deterring label
• The highest score also determines the quality of
the segment
– Segmentation algorithm needs this score to
determine the optimal segmentation
Tie Breaking
•
•
•
Tie breaking Scheme as describe in “Algorithms for Chordal Analysis”
Decisions are made in this order with following decisions occurring if previous
decisions fail to determine a winner
This is a basic set of tie breakers
A more exhaustive decision making process or different ordering of decisions could
be used to improve results
Complexity
• Time generating minimum segments depends
number of MIDI events(note on/off events)
• Generating minimum segments is linear time
• Calculating weights is linear time
Scoring the Algorithm
• Algorithm tested using input from a music
theory textbook by Kostka and Payne
• Answer key provided so that the algorithm
results can be scored
– One point given for each correct answer
– Partial point given for a correct answer being one
of multiple guesses (multiple guesses occurring if
a tie is not resolved)
Labeling Algorithm Score
• Scores of the labeling algorithm by itself
• Segmentation taken from the answer key
Table of average scores from “Algorithms for Chordal Analysis”
Classification of Errors
Figure from “Algorithms for Chordal Analysis” Showing error classifications
Segmentation
• In this system segmentation is solved as a
graph problem
• Solution is found by finding an optimal path
through the graph
Directed Acyclic Graph
• A graph is a set of nodes connected by edges
• Acyclic means you can not re-visit a node if
you move along any number of edges on the
graph
• Directed means an edge has a direction and
you can only travel along an edge if it is
pointing in the right direction
Sample Graphs
Graph with no cycles
Graph with a cycle
Directed graph with no cycles
Directed graph with a cycle
Graph Used in System
• Partitions are represented as nodes in a
directed acyclic graph
• Earlier partition node is connected to every
partition that comes after it in the musical
piece
• Edges represent the segment that is bounded
by the partitions it connects
• A weight is given to each edge by performing
the labeling algorithm on every segment
Sample of Graph Generated by System
Start of piece
End of piece
The Graph Algorithm
• Goal is the traverse the graph (generate
segments) from beginning to end which gives
highest sum of scores for the created
segments
• The relaxation algorithm solves this problem
The Relaxation Algorithm as seen in “Algorithms for Chordal Analysis”
Sample of Graph Generated by System
Start of piece
End of piece
0
?
2
?
?
?
Sample of Graph Generated by System
Start of piece
End of piece
0
?
2
?
3
?
Sample of Graph Generated by System
Start of piece
End of piece
0
?
2
?
3
6
Sample of Graph Generated by System
Start of piece
End of piece
0
?
2
8
3
6
Sample of Graph Generated by System
Start of piece
End of piece
0
11
2
8
3
6
HarmAn Speed Improvement
• Reduces complexity of the algorithm and
increases it’s speed
• Reduces accuracy: Does not find the optimal
path through graph
The HarmAn Algorithm as seen in “Algorithms for Chordal Analysis”
Accuracy Of Algorithm
Score results as seen in “Algorithms for Chordal Analysis”
Conclusion
• A basic algorithm has been presented with ok
results
• Much room for improvement
• Need to improve segment scoring
Reference
Bryan Pardo. William P. Birmingham “Algorithms
for Chordal Analysis.” Computer Music Journal.
MIT Press, 2002. 27-49.