Notes on David Temperley s What s Key for Key? The Krumhansl-Schmuckler Key-Finding Algorithm Reconsidered By Carley Tanoue

Similar documents
University of California Press is collaborating with JSTOR to digitize, preserve and extend access to Music Perception: An Interdisciplinary Journal.

Pitch Spelling Algorithms

2 The Tonal Properties of Pitch-Class Sets: Tonal Implication, Tonal Ambiguity, and Tonalness

Perceptual Tests of an Algorithm for Musical Key-Finding

Influence of timbre, presence/absence of tonal hierarchy and musical training on the perception of musical tension and relaxation schemas

On Interpreting Bach. Purpose. Assumptions. Results

T Y H G E D I. Music Informatics. Alan Smaill. Jan 21st Alan Smaill Music Informatics Jan 21st /1

Example 1 (W.A. Mozart, Piano Trio, K. 542/iii, mm ):

HOW DO LISTENERS IDENTIFY THE KEY OF A PIECE PITCH-CLASS DISTRIBUTION AND THE IDENTIFICATION OF KEY

David Temperley, The Cognition of Basic Musical Structures Cambridge, MA: MIT Press, 2001, 404 pp. ISBN

A Probabilistic Model of Melody Perception

Music Theory II (MUSI 1311), Summer 2007 Professor: Andrew Davis ( )

Augmentation Matrix: A Music System Derived from the Proportions of the Harmonic Series

HST 725 Music Perception & Cognition Assignment #1 =================================================================

Harmonic Visualizations of Tonal Music

COURSE OUTLINE. Corequisites: None

CHAPTER ONE TWO-PART COUNTERPOINT IN FIRST SPECIES (1:1)

Student Performance Q&A:

Student Performance Q&A:

A probabilistic framework for audio-based tonal key and chord recognition

A PROBABILISTIC TOPIC MODEL FOR UNSUPERVISED LEARNING OF MUSICAL KEY-PROFILES

Course Objectives The objectives for this course have been adapted and expanded from the 2010 AP Music Theory Course Description from:

AP Music Theory COURSE OBJECTIVES STUDENT EXPECTATIONS TEXTBOOKS AND OTHER MATERIALS

A.P. Music Theory Class Expectations and Syllabus Pd. 1; Days 1-6 Room 630 Mr. Showalter

Lesson RRR: Dominant Preparation. Introduction:

The Composer s Materials

An Integrated Music Chromaticism Model

AP Music Theory Syllabus

Homework Booklet. Name: Date:

AP Music Theory at the Career Center Chris Garmon, Instructor

BLUE VALLEY DISTRICT CURRICULUM & INSTRUCTION Music 9-12/Honors Music Theory

10 Visualization of Tonal Content in the Symbolic and Audio Domains

Course Overview. At the end of the course, students should be able to:

Lesson Week: August 17-19, 2016 Grade Level: 11 th & 12 th Subject: Advanced Placement Music Theory Prepared by: Aaron Williams Overview & Purpose:

AP MUSIC THEORY 2015 SCORING GUIDELINES

Study Guide. Solutions to Selected Exercises. Foundations of Music and Musicianship with CD-ROM. 2nd Edition. David Damschroder

Student Performance Q&A:

PART-WRITING CHECKLIST

AP MUSIC THEORY 2006 SCORING GUIDELINES. Question 7

USING HARMONIC AND MELODIC ANALYSES TO AUTOMATE THE INITIAL STAGES OF SCHENKERIAN ANALYSIS

CSC475 Music Information Retrieval

Student Performance Q&A:

The Baroque 1/4 ( ) Based on the writings of Anna Butterworth: Stylistic Harmony (OUP 1992)

AP MUSIC THEORY 2016 SCORING GUIDELINES

Tonal Cognition INTRODUCTION

AP Music Theory. Sample Student Responses and Scoring Commentary. Inside: Free Response Question 7. Scoring Guideline.

AQA A Level Music. Listen to Haydn s 104 Symphony a number of times and follow the score. You will be able to find the score on this website.

Music Theory II (MUSI 1311), Spring 2010 Professor: Andrew Davis ( )

MUSC 201: Tonal Harmony

University of California Press is collaborating with JSTOR to digitize, preserve and extend access to Music Perception: An Interdisciplinary Journal.

Partimenti Pedagogy at the European American Musical Alliance, Derek Remeš

AP Music Theory

MUS305: AP Music Theory. Hamilton High School

Figured Bass and Tonality Recognition Jerome Barthélemy Ircam 1 Place Igor Stravinsky Paris France

Sequential Association Rules in Atonal Music

Arts, Computers and Artificial Intelligence

Theory II (MUSI 1311) Professor: Andrew Davis ( )

Student Performance Q&A:

Using the Modes and Applying Them

AP MUSIC THEORY 2011 SCORING GUIDELINES

AP Music Theory 2010 Scoring Guidelines

AP Music Theory Policies and Procedures

University of California Press is collaborating with JSTOR to digitize, preserve and extend access to Music Perception: An Interdisciplinary Journal.

Comprehensive Course Syllabus-Music Theory

AP MUSIC THEORY 2013 SCORING GUIDELINES

Expected Competencies:

Syllabus for MUS 201 Harmony, Sight Singing, and Ear Training III Fall 1999

Curriculum Development In the Fairfield Public Schools FAIRFIELD PUBLIC SCHOOLS FAIRFIELD, CONNECTICUT MUSIC THEORY I

MUSIC THEORY CURRICULUM STANDARDS GRADES Students will sing, alone and with others, a varied repertoire of music.

SAMPLE ASSESSMENT TASKS MUSIC GENERAL YEAR 12

Advanced Placement (AP) Music Theory

AP Music Theory. Scoring Guidelines

Homework 2 Key-finding algorithm

Course Syllabus Phone: (770)

MUSIC CONTENT ANALYSIS : KEY, CHORD AND RHYTHM TRACKING IN ACOUSTIC SIGNALS

Machine Learning Term Project Write-up Creating Models of Performers of Chopin Mazurkas

Elements of Music - 2

Sequential Association Rules in Atonal Music

BLUE VALLEY DISTRICT CURRICULUM & INSTRUCTION Music 9-12/Music Theory

Melodic Minor Scale Jazz Studies: Introduction

AP Music Theory 2013 Scoring Guidelines

Detecting Musical Key with Supervised Learning

Measuring and modeling real-time responses to music: The dynamics of tonality induction

Visual Hierarchical Key Analysis

Theory of Music. Clefs and Notes. Major and Minor scales. A# Db C D E F G A B. Treble Clef. Bass Clef

Proceedings of the 7th WSEAS International Conference on Acoustics & Music: Theory & Applications, Cavtat, Croatia, June 13-15, 2006 (pp54-59)

GRADUATE/ transfer THEORY PLACEMENT EXAM guide. Texas woman s university

AP Music Theory Syllabus CHS Fine Arts Department

MUS100: Introduction to Music Theory. Hamilton High School

AP Music Theory Syllabus

Audio Feature Extraction for Corpus Analysis

CHORDAL-TONE DOUBLING AND THE ENHANCEMENT OF KEY PERCEPTION

This slideshow is taken from a conference presentation (somewhat modified). It summarizes the Temperley & Tan 2013 study, and also talks about some

Construction of a harmonic phrase

TABLE OF CONTENTS. Lesson 1: Major and Minor Key Signatures...1. Lesson 2: Scales Lesson 3: Intervals...21

CARNEGIE MELLON UNIVERSITY SCHOOL OF MUSIC FORM AND ANALYSIS FALL 2011

PLACEMENT ASSESSMENTS MUSIC DIVISION

A geometrical distance measure for determining the similarity of musical harmony. W. Bas de Haas, Frans Wiering & Remco C.

AP Music Theory Syllabus Music Theory I Syllabus Cypress Lake Center for the Arts Gary Stroh, instructor School Year

AP Music Theory Syllabus

Transcription:

Notes on David Temperley s What s Key for Key? The Krumhansl-Schmuckler Key-Finding Algorithm Reconsidered By Carley Tanoue I. Intro A. Key is an essential aspect of Western music. 1. Key provides the framework whereby notes and harmonies are understood in tonal music. a) Perception of musical elements: (1) Perception of stability or appropriateness of pitches and chords (2) Perception of melody more easily remembered and more easily recognized. Perception of modulation: allows tonal music to convey a sense of long-range motion and drama.

B. Thesis 1. Point to some important problems with the key-profile algorithm of Carol Krumhansl and Mark Schmuckler and propose solutions. 2. He suggests that the key-profile model can provide a highly effective approach to key finding. 3. Also examines some alternative solutions to the keyfinding problem. 4. Using a computational approach, his goal is to model judgments of music theorists made reflectively and analytically. II. Basis: The Krumhansl-Schmuckler Key-Finding Algorithm A. Based on key profiles. Key profile: Vector of 12 values. B. Each of the 24 major and minor keys has its own key profile. C. The algorithm judges the key of a piece by correlating each key profile with the input vector of the piece 1. Input vector: A 12-valued vector, with each value representing the total duration of a pitch class in the piece. 2. The correlation value between the input vector and a given key-profile vector is calculated. 3. The key profile yielding the highest correlation gives the preferred key. D. Modifications: 1. Simplification in the way the key-profiles scores are calculated.

a) OLD: The current correlation formula uses a complex relationship and normalizes both vectors for their mean and variance. b) NEW: The same result by defining the key-profile score simply by the scalar product of the key-profile vector value and the input-vector value (_xy) Calculate the scores for all 24 keys and choose the highest score. E. Old Algorithm Tests 1. The algorithm was tested on the first four notes of each of the 48 preludes of Bach s Well-Tempered Clavier and on the first four notes of Shostakovich s and Chopin s preludes. a) The only test that provides clear data about the judgments of the basic algorithm for isolated segments of music. b) Unrealistic because of the pieces more complex tonal language. 2. The algorithm was given a series of notes sequences starting from the beginning of the piece until the algorithm chose the correct key, then the test was terminated. 3. The algorithm was tested on each measure of Bach s Prelude no. 2 in C minor and its judgments were compared to experts as to the key of each measure. F. New Test a) The context of each measure were taken into account in judging its key. 1. An easy and informal way of testing the algorithm is by giving it a piece, having it judge the key for many small segments of the piece in isolation, ex. measures, and comparing the results with our own judgments.

a) Each segment is to be regarded in isolation, without considering its context. G. Results of New Test 1. The algorithm makes incorrect judgments on 13 of 40 measures, a correct rate of 67.5%. H. Reason for Errors (analyzing the key-profile values) 1. Counterintuitive that diatonic degrees have only slightly higher values than chromatic keys. a) In minor: Flattened 7 th degree has a higher value than the leading tone. b) In Major: Leading tone has the lowest value of the seven diatonic degrees. 2. The dominant 7 th, which is usually taken as strong implications of the corresponding tonic key, is not so judged by the K-S algorithm. 3. It seems likely that some of the minor values are too high. Model chooses minor keys too often. I. Modification #1 New Key-Profile Values 1. Arrived at by a mixture of theoretical reasoning and trial and error, using a variety of different pieces for testing. 2. Improved performance on the Bach Courante. 3. New problem: Repetitions of notes affect the result, but do not appear to strongly tilt the key implications. J. Modification #2 Template Matching Approaches 1. K-S model a) Weighted-input/Weighted-key approach. 2. Longuet-Higgins and Steedman s approach

a) Flat-input/Flat-key approach. b) Processes a piece from left to right. c) Eliminates keys until it is left with only one. d) Each key has a flat key profile (1 = diatonic scale, 0 = chromatic pitch classes). e) Flat input vector (1 = present, 0 = absent). 3. L-H & S Problem #1 a) The algorithm has no way of judging passages in which all the pitches present are in more than one scale. (1) K-S model makes important distinctions between diatonic scale degrees.

b) Modification: Create a Flat-input/Weighted-key approach. K. Connections Between New approach and Other Theoretical Work 1. Fred Lerdahl Theory of tonal pitch space. a) Based on a basic space consisting of several levels, corresponding to the chromatic scale, diatonic scale, tonic triad, tonic and fifth, and tonic. b) Result: Modification of higher values for the 4 th, 7 th, and lower value for flat 7 th. Also equal values for 3 rd and 5 th diatonic degrees. 2. David Butler Rare-interval approach. a) Certain small pitch class sets have particular relevance for key finding, because of their rarity. b) Result: Modification of boosting 4 th and 7 th. (1) Effect: Sharpen the model. Lowers the similarity between each key s profile and the key profiles of its closest neighbors.

III. Modulation A. Definition: Vital part of tonal music. Tonicizations. B. Difficult: C. Result: 1. Problem: The division of the piece into key sections would allow to infer when the key is changing as well as the global key. a) Solution: Analyze in segments of a piece in insolation. b) Changes of key would emerge at places where one segment s key differed from that of the previous one. 2. Problem: Intuitively, key has inertia and would prefer to remain in one key unless there is strong and persistent evidence to change. a) Solution: Impose a penalty for choosing a key for one segment that differs from the key of the previous one. b) Optimizing the key-profile match for each segment while minimizing the number of key changes. 1. New Computational approach (Program): a) The score for an analysis is the sum of the keyprofile scores and change penalties for each segment. b) The program uses dynamic programming to find the highest-scoring possible analysis without having to generate them all. c) Parameters: (1) Change Penalty (2) Length of segments

(a) Problem: Because a flat input profile is being used for the individual segments, the combined input vectors for two segments are not the same as the input vector for a single larger segment containing both. (b) Solution: Adjust the key-profile scores by the length of the segments. IV. Preference Rule System vs. Procedural systems A. Procedural Systems: 1. ex. Longuet-Higgins and Steedman s model. 2. Systems that are more easily descrived in terms of the procedure they follow rather than the output they produce. 3. Holtzmann s model Searches a melody for certain features; first from the beginning and end of the melody and then at points in between. 4. Winograd s and Maxwell s Systems for harmonic analysis Roman numeral analysis, requiring inferring key information. 5. Vos and Van Geenen gathers weight for all keys, like a key-profile model, according to pitch and harmonic evidence. B. Preference Rule Systems (Temperley s Model): 1. Definition: A system that considers many possible analyses of a piece or passage, evaluates them by certain criteria and chooses the highest-scoring one. 2. Advantages: a) Handling of real-time processing. (1) The algorithm naturally handles the gardenpath effect: The phenomenon of revising one s hearing of a piece based on what happens afterwards.

(2) Insight into the kind of tonal analysis that goes on during listening. b) A numerical score for an analysis. (1) How much a piece satisfies the preference rules. (2) Key-fit scores. (a) Measure of the tonalness of pitch class sets. (b) Capture an important aspect of listening. (i) Rising and falling of musical tension of the phrase. (3) Problem: A segment containing more pitch classes will have a higher score. (a) Difficult to compare scores across segments. (4) Solution: Defining the key-fit score as the keyprofile scores divided by the number of pitch classes in the segment.

V. Testing the Model A. Input required for the program: 1. A list of notes, with a pitch, on-time and off-time for each note in the form of a MIDI file. 2. A list of segments, usually measures. B. Parameters: a) Rule: Given the tempo chosen, the segments used corresponded to the fastest level of metrical unit above 1 second. 1. Key Profiles: Not modified from last modification. 2. Change Penalty: Modified on each test, and the best performance value was used. C. Test #1: a) WHY: It seemed fair 1. Tested on 48 fugue subjects from Bach s Well- Tempered Clavier 2. Results: D. Test #2: a) On 42 of the 48 fugues, the system chose the correct key. b) 2 ties: _ point each, therefore score 43/48. c) There were four non-modulating themes where the program chose a single, incorrect, key. d) L-H & S System performed better, but has problems. 1. Tested on 46 excerpts from the Kostka-Payne theory textbook, Tonal Harmony by Stefan Kostka and Dorothy Payne.

E. Errors: 2. Results: a) Out of 896 segments, the program attained a score of 751: a rate of 83.8%. (1) Rate of 91.4% for examples related to diatonic chords. (2) Rate of 75.6% for examples related to chromatic sections. 1. Rate of modulation modulated too rarely or too often. a) Solution: Modify the change penalty. (1) The idea that this parameter has to be adjusted for different pieces is a flaw in the program. 2. Wrong chosen key due to harmony. a) Solution: Add a preference rule for tonic harmony and a primacy rule or implied tonic harmony. (1) For the program to use harmonic information, it would need to recover the harmonic structure of the input too complex and difficult. 3. Wrong chosen key due to the French sixth chords. a) Solution: Program needs inherent information on the conventional tonal implications of French 6 th Chords. (1) Harmonic information is needed where chromatic chords, whose tonal implications contradict the normal tonal implications of their pitch classes.

4. Key-Profile Refinement. a) Solution: Computational hill-climbing technique or by tallying of pitch classes in pieces for the basis of the key-profile values. VI. Spelling Distinctions A. Categories: 1. Tonal Pitch Classes (TPC s) 2. Neutral Pitch Classes (NPC s) B. Neutral Pitch Classes: 1. 12 pitches. Neutral model of pitch classes. C. Tonal Pitch Classes: 1. Spelling labels of pitch events are an important part of tonal perception. a) Labels can be inferred from context without relying on top-down key information, using preference rules. 2. There is a preference to spell events so that they are close together on the circle of fifths. 3. Possibility that spelling might be used as input to key determination. D. Results of testing with TPC instead of NPC 1. TCP version attained a score of 87.4% correct. 2. NPC version attained a score of 83.8% correct. 3. Spelling of key names themselves is musically important and the TPC-based model performs significantly better in choosing the correct spelling for each key.

VII. David Huron and Richard Parncutt: Huron-Parncutt algorithm. A. The key at each moment in a piece is determined by an input vectore of all the pitch events so far in the piece, weighted according to their recency. 1. Half-life curve. B. Implementation Test: 1. Used the Kostka-Payne test group. 2. Used the modified version of the key-profile values. 3. Used the same input format as in the previous tests. 4. Used the same segments as in the previous tests. a) Though Segmentation is not required. 5. NEW: For each segment, a global input vector was generated. C. Results: a) The sum of all the local input vectors for all the segments up to and including that segment, with each local vector weighted according to the exponential decay function. 1. With optimized half-life input: a) Scored correctly 628.5 out of 896 segments. b) Correct rate of 70.1%. D. Reasons for Disappointing performance. 1. Inability to backtrack. 2. No real defense against rapid modulation.

VIII. Conclusions A. Key-profile model 1. Successful solution to the key-finding problem B. Spelling, harmony and the Primacy factor appear to play a role in key finding.