Performing
What does a performer add to the notes, and how do players stay together?
In 2007 a critic's CD of Joyce Hatto went into a computer and the track database named another pianist: over a hundred recordings under her name were other people's, and timing analysis showed it, because no two pianists shape time alike. The part measures what a performer adds to a score. It plays the Tune exactly as written and as performed by five rules after the KTH system (phrase arch, duration contrast, high loud, punctuation, final ritardando), each heard alone and together at three strengths; derives the final ritardando from a runner braking (tempo squared falling linearly, q = 2); hears legato and staccato as held time; hears a 60-cent vibrato at its mean pitch; models ensembles by linear phase correction, where a duo's asynchrony shrinks by 1 - (alpha1 + alpha2) a beat, holds only for totals between 0 and 2 (best near 0.85 for our noise levels), drifts 264 ms in 24 beats with nobody listening and shakes apart above 2; compares democratic and autocratic quartets after Wing and colleagues; and fingerprints ten model pianists by their tempo curves: a time-stretched copy matches its source at 0.9999, a pianist's own second take at 0.988, other pianists at most 0.90. Practice (about a fifth of the differences in music, by meta-analysis), anxiety and the body close the part.
What you need. Part 4 for loudness; Part 6 for tuning; Part 7 for the piano; Part 10 for notation; Part 11 for meter; Part 37 for ensemble timelines. Autoregressive processes, correlation.
- Ideas, mathematics and history
- expressive timing and dynamics, vibrato, intonation in practice, ensemble synchronization, practice science, the Hatto hoax
- What we build, compute and hear
- an expressive performer; an ensemble that stays together, and one that does not
What you will be able to do
Foundations
- Hear a deadpan and an expressive performance of the same notes, and name what changed.
- Hear legato and staccato, a vibrato's pitch, and three shapes of final ritardando.
- Hear a duo that holds, one that drifts and one that shakes apart.
Full course
- Implement performance rules and the kinematic ritardando, and measure a performance's deviations.
- Derive a duo's asynchrony variance under linear phase correction, and its stability bound.
- Identify a performer, or a copy, by correlating normalised tempo curves.
Research
- Design a study that separates an interpretation from the common part of expression and from noise.
Practice
- Humanise sequenced parts; decide who leads in chamber music; practise with spacing and interleaving.
Contents
Each chapter has a home level. Choose a track to see what to read and watch: Foundations 24 min · Full course 30 min · Research 32 min · Practice 30 min.
- 0Who is playing?Foundations2 min
- 1What a performer addsFoundations2 min
- 2Rules of expressionFoundations3 min
- 3Slowing downFoundations3 min
- 4Loudness and articulationFoundations2 min
- 5Vibrato and intonationFoundations2 min
- 6Playing togetherFoundations4 min
- 7Quartets and conductorsFoundations3 min
- 8Who is playing?Practice3 min
- 9Practice and the performer's bodyPractice3 min
- 10Frontier: learning to performResearch2 min
- Variation 43, recap and problemsAll tracks2 min
Also on this page: Lecture · Key results · Try it · Lab · Problems · Notes and sources · Build the film.
Lecture
The text of each chapter is the film's narration, as it is spoken, so you can read along or revise without the film. The pictures are in the film. A dashed box stands for a number the film computes when it is rendered (hover over it to see what is computed); the README's figures for each chapter, where it lists them, follow the chapter's text.
Who is playing?Foundations2 min
In February 2007 a Joyce Hatto CD went into a computer, and a track database named a different pianist. Judge for yourself. Three synthetic model performances of the same two phrases, labeled as if released under three pianists' names; these are not Hatto recordings. Two of them are really one and the same recording. Which two?
The first and the third. The third is the first recording slowed down by five per cent, which moves every note but keeps the proportions between them. Measure each recording's timing shape, the pattern of long and short notes after removing the overall tempo, and the first and third correlate ; the second correlates with either. In 2007 the same kind of measurement exposed one of the strangest frauds in recording history.
Joyce Hatto was an English pianist who had stopped giving concerts, and who late in life issued over a hundred CDs on a small label. Critics praised them. In February 2007 one of the discs went into a computer, and the online track database named a different pianist. Her husband, the producer, had copied other pianists' recordings, sometimes time-stretched or re-equalised to disguise them. Timing analyses, among them Nicholas Cook and Craig Sapp's, matched the recordings note by note, because matching detailed timing and audio can provide strong evidence of a shared recording. This part asks what a performer adds to the notes, and measures it in milliseconds.
Here is the plan. What a performer adds to the score: timing, loudness and articulation. Rules of expression, and the physics of slowing down. Vibrato, and the pitch it is heard at. Playing together: how players correct each other, and when correction fails. Who is playing: an identity test on timing. And practice, anxiety and the performer's body.
1What a performer addsFoundations2 min
What is missing from a score played exactly?
In 1938 the psychologist Carl Seashore wrote that the artistic expression of feeling in music lies in deviation from the exact. His laboratory in Iowa filmed piano hammers and photographed singers' pitch, and found that nobody played as written. A score fixes pitches and proportions; a performance chooses milliseconds, loudness and connection. A computer playing the score exactly gives the deadpan performance, the reference every study measures from. Part 10's notation leaves all this out on purpose.
Hear the Tune's first two phrases twice: first exactly as written, then performed by a handful of rules we will take apart in the next chapter. The notes are the same; listen for what changes.
Draw the difference, note by note. Lengths: the notes near each phrase's start and end are stretched, the last of each phrase by up to per cent, and the middles keep the written tempo. Loudness: each phrase swells to its middle and falls away, and the higher notes stand out. Two phrases, fourteen notes, and the shape is already unmistakably a performer's.
What can a performer change? Timing: when each note starts, and how the tempo bends across a phrase. Dynamics: how loud each note is, and how loudness moves. Articulation: how long each note lasts against the gap to the next. And on instruments that allow it, timbre and the exact pitch. A pianist, as Part 7 showed, controls key and hammer motion, releases and pedals, with effects from action, voicing, instrument condition and recording context; three note parameters are only our simplification.
Do performers agree? In 1992 Bruno Repp measured twenty-eight recordings of Schumann's Träumerei by twenty-four famous pianists. Almost all of them slowed at the same places: at phrase ends, and above all at the end of the piece. The shared pattern looked like a body coming to rest; the individuality lay in the details. So a typical timing profile, and each performer's departures from it, can both be measured. Chapter two writes rules that produce the common part.
2Rules of expressionFoundations3 min
Can expression be written as rules?
Can expression be written down as rules? A group at the Royal Institute of Technology in Stockholm, Johan Sundberg, Anders Friberg, Roberto Bresin and colleagues, has tried since the 1980s. Their method is analysis by synthesis: propose a rule, let a computer play it, and let a professional musician judge. About thirty rules came out of it: the phrase arch, duration contrast, high loud, punctuation, the final ritardando, melodic charge and more. Each rule has a strength, k, and a performance is the sum of chosen rules at chosen strengths. Our module implements five of them, simplified.
Hear each rule alone, exaggerated so it is easy to catch, on the Tune's first two phrases: as written; the phrase arch, slower and softer at the ends of each phrase; duration contrast, long notes a little longer; high loud, the higher notes louder; punctuation, a breath after each phrase; and the final ritardando, slowing to a stop. Each panel shows what its rule changes, note by note.
How do the rules combine? A note's length is its written length times one plus k times the weighted sum of the stretches each rule asks for. Its velocity is the base velocity plus k times the weighted sum of the rules' changes. The weights are a performer's taste: one pianist arches every phrase, another barely slows. Friberg's program Director Musices lets a user set them and hear the result. In chapter eight we give ten model pianists ten sets of weights, and try to tell them apart.
Hear all five rules together at three strengths: k equal to zero, which is the score as written; k equal to one, a moderate performance; and k equal to two, every effect doubled. Listeners in the KTH studies usually preferred moderate strengths: too little sounds mechanical, too much sounds mannered.
How far do rules go? They capture the common part of expression well, and listeners prefer rule performances to deadpan ones. They miss interpretation: which phrase is the climax, which voice to bring out, what the piece is about. Gerhard Widmer's machine learning found rules of its own in about a hundred thousand notes played by a concert pianist, in 2002, and today's models learn expression from large recorded datasets, chapter ten's subject. Chapter three looks at the one rule with something like a law of physics behind it.
3Slowing downFoundations3 min
Why does a final ritardando sound like a body coming to rest?
In 1999 Anders Friberg and Johan Sundberg compared two things: runners stopping after a sprint, and final ritardandi in recordings. A runner braking with constant force loses speed squared in proportion to distance, so the speed falls as the square root of the distance left: gently at first, then quickly at the very end. Musicians' final ritardandi, measured against position in the score, follow nearly the same curve. Tempo behaves like the speed of a body in motion.
Their model is one formula. Tempo v, at position x through the ritardando, equals one plus w to the q minus one, times x, all to the power one over q, where w is the final tempo. With q equal to one, the tempo falls in a straight line. With q equal to two, it falls like the runner's speed under constant braking. With q equal to three, it holds on longer and drops more steeply at the very end. The recordings Friberg and Sundberg measured sat around q of two to three.
Hear the Tune's last phrase slowing to half speed along the three curves, q equals one, two and three. Which one comes to rest most naturally?
In listening tests, ritardandi with q around two or three were preferred to the straight line, which tends to sound as if it brakes too early. The differences are tens of milliseconds a note, and the ear notices them.
Slowing at a boundary is not only musical. Speech slows at the ends of phrases too: the last syllable before a pause is lengthened, in language after language. Infants and adults use that lengthening to find where phrases end, in speech and in melodies. A performer slowing at a phrase end may be borrowing a cue every listener already knows. Part 47 asks which features of music are shared with speech, and which are universal.
The idea goes further. Neil Todd modelled the whole phrase arch as motion: tempo and loudness rising and falling together like speed. In his model the tempo is the velocity of a mass pushed by the phrase structure. Why should music move like a body? Perhaps because we hear it with brains that track motion, a question for Part 46. Performers talk of weight, momentum and arrival; these models take the words literally. Chapter four turns to loudness and articulation.
4Loudness and articulationFoundations2 min
How does a pianist connect two notes?
Loudness first. Here is every note's velocity in the performed Tune, all six phrases. Each phrase swells towards its middle and falls away at its ends, the phrase arch; within that, the higher notes stand out. Measured performances show the same coupling: where pianists slow down they usually also play softer, so loudness and tempo rise and fall together.
Articulation is how long each note is held against the time before the next one. Hear the first phrase three ways: legato, each note held a little past the start of the next; as written, with a small gap; and staccato, each note released early. The onsets are identical; only the releases move.
Piano legato often uses overlapping key holds, but perceived connection also depends on pedal, register, decay and texture. Bruno Repp measured it in 1997: pianists overlap legato notes by tens of milliseconds, and the overlap grows with the time between notes. Staccato, portato and tenuto are points on the same scale of held time. And the sustain pedal adds another layer, keeping the strings sounding after the keys are released, as Part 7 showed.
What about touch? Pianists have long argued about whether they can change a note's tone colour, and not only its loudness. For a single note, hammer velocity is a major determinant of a fixed piano note's string excitation; pedal state, action and release noises, and instrument condition also matter. But touch also means the timing between voices, the balance within a chord, the pedal. So colour on a piano is mostly how many notes are balanced and timed, not one note's tone. Chapter five turns to instruments whose players shape every note's pitch.
5Vibrato and intonationFoundations2 min
If the pitch keeps moving, which pitch do we hear?
A question for your ears. A plain note, and then a note with a wide vibrato, its pitch swinging up and down. Is the second higher than the first, lower, or the same?
The same. The vibrato swings sixty cents either side of 440 hertz, more than half a semitone, five and a half times a second, and its average is hertz. For suitable rates and symmetric vibrato, listeners often hear a pitch near its center, though averaging in hertz and cents differs and the result depends on waveform, as Shonle and Horan found in 1980, even though the sound passes through that pitch only for an instant in each swing.
Rate matters as much as width. Hear the same swing of forty cents at three, six and ten times a second.
At three it sounds like a wobble in pitch; at ten, a nervous tremble; around five to seven, it fuses into one warm, living tone. These are illustrative rate judgments, not universal preferences across voices, instruments and traditions.
Some facts. Singers' vibrato runs at about five and a half to seven swings a second, typically half a semitone to two semitones from top to bottom. Seashore's films of the 1930s found it in nearly every good singer's tone. String players make it by rocking a finger on the string; wind players with the breath or the lip. It is also a style: continuous vibrato in orchestral strings became standard only in the twentieth century, and the period-performance movement of Part 25 plays most earlier music with less.
Players who can bend pitch also choose it. They may adjust pitches away from equal temperament according to ensemble, style and musical role. String players and singers raise leading tones and sharpen major thirds in melodies, and in sustained chords lean towards pure intervals: barbershop quartets tune the dominant seventh near the ratio seven to four. Intonation in practice is a compromise between melody's pull and harmony's purity, decided note by note. Chapter six turns to two players keeping time together.
6Playing togetherFoundations4 min
How do two players stay together? The standard model is simple. Each player has an inner timekeeper: the next note is due one period after the last, give or take some noise. Each hears the asynchrony, how far the partner's last note was from their own, and corrects the next note by a fraction alpha of it. For a duo, the asynchrony then shrinks each beat by the factor one minus the two players' alphas, plus fresh noise. This is Dirk Vorberg and Alan Wing's linear phase correction model, from 1996.
A question for your ears. Three model duos, each playing twenty-four beats, one player on a high note and one on a low note. Their inner tempos differ by a little over two per cent. In one duo, nobody listens to the other. Which one?
The second. With nobody correcting, the small difference in tempo accumulates, and the low player falls milliseconds behind by the last beat. In the first duo both correct by a quarter of each asynchrony, and they stay within a few tens of milliseconds. The third is the strange one: one player corrects by more than the whole asynchrony, so every correction overshoots, and the duo shakes itself apart, alternating sides by more and more.
How much should players correct? The asynchrony's spread can be written in closed form: it is finite only when the total correction lies between zero and two, the walls of stability. Simulations, three thousand beats for each point, sit on the formula. The best total, for these noise levels, is about : a little less than correcting the whole asynchrony at once, because some of what is heard is motor noise that will not repeat.
One more finding from tapping. Tap along with a metronome and you will tap early, typically twenty to fifty milliseconds before the click: the negative mean asynchrony, common in these tasks, often smaller in musicians and dependent on feedback and instructions. One explanation is that the brain times the feel of the tap, which reaches it later than the sound of the click. Ensembles have offsets of their own, so the lead player's onset is not the only true beat. And all of this is prediction, not reaction: simple auditory reactions typically take much longer than ensemble asynchronies; predictive timing is central, alongside ongoing feedback.
What does this say about real players? Tapping experiments, reviewed by Bruno Repp in 2005 and 2013, find people correct by roughly a quarter to a half of each asynchrony. A leader who corrects little and a follower who corrects a lot stay together just as well as two equals, so who leads is a question about the alphas, and it can be measured from recordings. Over-correcting is real too: ensembles that chase each other's errors rush and drag in turn. Chapter seven adds two more players, and a conductor.
7Quartets and conductorsFoundations3 min
Who leads a string quartet?
In 2014 Alan Wing, Satoshi Endo, Adrian Bradbury and Dirk Vorberg recorded two professional string quartets. From every note's onset they estimated how much each player corrected towards each other player: a four by four matrix of alphas. One quartet was, in their word, autocratic: the first violin corrected little, and the others corrected towards the first violin. The other was democratic: everyone corrected towards everyone. Both stayed together. They differed in who does the adjusting.
Here are two model quartets of ours in that spirit. An arrow from one player to another means the first corrects towards the second, and its thickness says how much. In the democratic quartet every player corrects a little towards every other. In the autocratic one, the second violin, viola and cello correct strongly towards the first violin, which hardly listens back. Simulated over four thousand beats, their average spread from earliest to latest player is almost the same, and milliseconds. The structure of listening differs; the togetherness does not.
Hear both, each player as one voice of a piano chord, sixteen chords each. Listen for any difference in how together they sound.
They are very hard to tell apart by ear: the spreads in these two clips are and milliseconds. Similar onset spreads do not uniquely reveal leadership; estimating correction patterns requires a model and suitable data; that is why Wing and his colleagues had to estimate it.
What about a full orchestra? It is too large to listen around: sound takes thirty milliseconds to cross ten metres, more than a duo's whole asynchrony. The conductor supplies a shared visual reference while players continue listening to one another. Studies of conductors' gestures find players lock to the lowest point of the beat and to sharp changes in the hand's speed. Orchestras still play slightly after the beat, by an amount each orchestra learns. And a conductor shapes tempo, balance and phrasing: the interpretation, not only the clock.
Other traditions stay together in other ways. In West African drumming, Part 37, players lock to a timeline, not only to each other. In jazz rhythm sections the drummer and bassist hold slightly different places on the beat, on purpose. Duos clapping over a network, in Chris Chafe's experiments of 2010, slowed down steadily once the delay passed about twenty-five milliseconds, each waiting for a partner who seemed late. And machines that accompany a soloist must estimate the soloist's tempo and correct, like a partner. Chapter eight treats timing as a signature.
8Who is playing?Practice3 min
Can timing identify a performer?
How can timing identify a performer? Tap along with a recording, or let software find each beat, and you have a list of beat times. Normalize inter-onset intervals to compare timing shape across overall speeds; this program specifically centers and standardizes their logarithms. Uniform time scaling preserves this normalized curve; nonuniform time warping and edits need not. Compare curves by correlation: one means the same shape. Nicholas Cook and Craig Sapp measured hundreds of recordings of Chopin's mazurkas this way at a British research centre for the history and analysis of recorded music.
Try it on ten model pianists, each with its own weights for the rules, its own tempo and its own habits, playing the whole Tune. Then take pianist D's recording, slow it by three per cent, add two milliseconds of editing jitter, and release it under a new name. Here is pianist D's tempo curve; the new release's; and pianist B's. Every curve rises at the phrase ends, because every pianist follows the same rules; the details are what differ.
Now correlate. The ten pianists against one another: brighter is more similar. Their curves correlate on average, because they share the rules, and never more than . The new release against all ten: pianist D at , the next at . And a second, honest take by pianist D scores : this model's fresh take differs more than its constructed copy. No universal correlation threshold proves copying in real performances.
Timing analysis also turns recordings into history. A century of records is a century of performance data. Robert Philip showed in 1992 that early twentieth-century players used far more rubato, portamento and tempo change than later ones; vibrato widened and became continuous, and tempo flexibility within a movement shrank. Performance style changes like any other style, and playing as the composer intended is itself a period idea. The measurements of this part make such histories quantitative.
Some caveats. Real recordings add rubato that no rule predicts, and edits that splice takes together. The Hatto evidence also came from the sound itself: the same piano, the same room, the same background noise. Timing analysis now studies performance history: how tempo and rubato changed across a century of records. And the same measurements show what is personal: the part a student cannot copy from a score. Chapter nine asks how performers are made.
9Practice and the performer's bodyPractice3 min
What does practice explain, and what does it cost?
How are performers made? In 1993 Anders Ericsson, Ralf Krampe and Clemens Tesch-Römer studied violin students at a Berlin academy, ranked by their teachers. The best had practised alone about ten thousand hours by the age of twenty; the least good, about five thousand. They called the key ingredient deliberate practice: effortful, focused on weaknesses, with feedback, and not just playing. It was popularised as a ten-thousand-hour rule, which the authors did not claim. How much of skill does practice actually explain?
In 2014 Brooke Macnamara, David Hambrick and Frederick Oswald pooled eighty-eight studies. Deliberate practice accounted for about twenty-one per cent of the differences in performance in music, twenty-six in games, eighteen in sports, four in education, and under one per cent in the professions. Practice matters a great deal in music, and leaves substantial unexplained variation. These observational associations neither allocate the remainder among causes nor measure an individual's potential.
What makes practice work? Studies of motor learning give some answers. Spacing beats massing: practice spread over days is retained better than the same hours in one block. Interleaving, mixing passages and tempos within a session, helps later performance, though it feels worse at the time. Slow practice and chunking build a passage from units the hands can run without attention. Mental practice works too, less than physical practice: the motor plan is rehearsed without the muscles. These are the same findings as in sport.
Then there is the stage. Performance anxiety is common: in surveys of orchestral musicians a large minority report it as a problem. Some arousal helps; too much narrows attention and stiffens the hands. In trials, cognitive and behavioural therapy, graded exposure and preparation help. Some musicians use prescribed beta-blockers for physical symptoms; effects, contraindications and treatment choices require individual clinical assessment. And memory: performers memorise by sound, by hand, by sight and by structure, so that when one fails another can rescue it.
Performing is also physical work. Overuse injuries of the hands, arms, neck and back are the commonest complaint. Task-specific focal dystonia, a complex neurological movement disorder affecting voluntary control, affects roughly one professional musician in a hundred. Hearing is at risk too: orchestral players can exceed safe daily noise doses, the woodwinds seated in front of the brass being the classic case. The European Union's 2003 noise directive applies to orchestras, which now use screens, seating plans and earplugs. Chapter ten turns to machines that learn to perform.
10Frontier: learning to performResearch2 min
Can a machine learn expression from recordings?
Seashore's deviations from the exact are now data. Computer-monitored pianos record every key and pedal: when it went down, how fast, when it came up. The MAESTRO dataset of 2019 holds about two hundred hours of competition performances recorded this way, aligned to the audio. Datasets such as ASAP match every performed note to its written note. These datasets expand the scale and reproducibility of expression research beyond earlier large performance collections.
Models learn expression from these data. The Basis Mixer, from Maarten Grachten, Carlos Cancino-Chacón and colleagues, maps features of the score to timing and loudness. VirtuosoNet, in 2019, uses a hierarchical network over notes, beats and measures. Models trained on audio now generate performances directly, with no score at all, Part 66's subject. Evaluation is the hard part: listening tests, and the distance to a human's version of the same piece. What they learn is the common part; whether a model can learn an interpretation is open.
Machines also play along. In 1984 Roger Dannenberg and, separately, Barry Vercoe built the first computer accompanists, following a soloist through the score. Christopher Raphael's Music Plus One models the soloist's timing probabilistically and learns it in rehearsal: chapter six's partner, with an estimated alpha and a prediction of the next note. Ensemble research now records eye gaze, breathing and body sway alongside the onsets, and finds that leadership shows in movement before it shows in sound.
A concrete version. Take many recordings of one piece by many pianists, aligned note by note to the score. Split each tempo curve into what the score's structure predicts and what is left. Ask listeners which recordings share an interpretation, without telling them who is playing. Is an interpretation a measurable object, separable from the common part and from noise? An answer would let a model be asked for an interpretation, not only for a plausible performance.
Variation 43, recap and problemsAll tracks2 min
Every part ends by doing something to the Tune with what it built. Here, the whole Tune, first exactly as written, then performed by this part's five rules: the same notes, with the differences drawn below. You will hear the written version first.
Row forty-three of the ledger. The measurement is the performance itself: phrase ends up to per cent longer than written, the last note per cent, and the whole Tune seconds as written and performed.
What did we find? A performance is the score plus deviations, measurable note by note. Rules capture the common part: arches, contrast, punctuation. A final ritardando slows like a body braking. Vibrato is heard at its average pitch. Players stay together by correcting a fraction of each asynchrony, and this duo model is stable when total correction lies between zero and two; quartet stability depends on its interaction matrix. And normalized timing can support recording identification, but requires corroboration rather than a universal copy threshold.
Five problems. One to compute, one to prove, one for your ears, one to build, and a research problem, marked with a star. Solutions are in this part's notes. Pause here.
Where does this come back? In music for picture, where players perform to a click and a film. In expectation and emotion. In MIDI and the workstation, where performance is data. In beat tracking and transcription. And in generative audio.
And in practice. Performers record themselves and look at the timing, not only listen. Producers humanise sequenced parts with small variations of timing and velocity. Chamber groups decide who leads each passage and rehearse the hand-offs. And teachers space practice, interleave it, and protect their students' hands and ears.
The books and papers this part follows. The full list, with notes, is in the README.
Our performers played for listeners who only listened. What does music do when it has a picture to serve, or a player to follow? Next time. Part 44: Music for Picture and Play.
Where it goes next. Music for picture in Part 44; expectation and emotion in Part 46; MIDI and the workstation in Part 53; beat tracking and transcription in Parts 61 and 62; generative audio in Part 66.
Key results
The part's results in one place, for revision.
Try it
Lab 43 · Performing, computed
Perform the Tune with rules at strengths you choose; set two players' corrections and watch them hold, drift or shake; and fingerprint model pianists by their timing.
python -m videos.music.labs 43
needs numpy, scipy, matplotlib · download lab43.py ·
source on GitHubthe Tune: seconds as written / performed 28.8 / 32.0
longest note against written; velocity range 1.26; 0.31 to 0.69
duo: total correction; exact spread if tempos were equal (ms) 0.60; 20.4
duo: asynchrony after 64 beats (ms) -25
the fake release: best match, then the runner-up (correlations) pianist G 0.9999; pianist E 0.878
ear problem: each duo, in order (listen first) holds (0.5), drifts (0), shakes (2.2)
Rules stretch and weight notes; a duo's asynchrony shrinks by 1 - (alpha1 + alpha2) a beat, so it holds only for totals between 0 and 2; and a time-stretched copy keeps its source's tempo curve exactly.
The code (74 lines; it asserts its own result)
"""Lab 43: performing, computed: rules of expression on the Tune, the kinematic ritardando, a duo's phase correction
and its stability, and the timing fingerprint."""
import numpy as np
from videos.coursekit import labs
from explainer.music.monochord import SR, Clip, concat, mix
from explainer.music.monochord import perform as P
from videos.music.music43 import compute as C
TITLE = "Performing, computed"
GOAL = ("Perform the Tune with rules at strengths you choose; set two players' corrections and watch them hold, drift or "
"shake; and fingerprint model pianists by their timing.")
TASKS = [
"Edit WEIGHTS and K. Which rule, turned up alone, most changes the total length? Which can you hear most clearly?",
"Set ALPHAS (each player's correction) and TEMPOS. Find the largest total correction that still holds together.",
"Change STRETCH and NOISE_MS for the fake release. How much editing noise hides a copy from the correlation test?",
]
WEIGHTS = {"phrase arch": 1.0, "duration contrast": 1.0, "high loud": 1.0, "punctuation": 1.0, "final ritardando": 1.0}
K = 1.0
ALPHAS = [0.3, 0.3]
TEMPOS = [0.5, 0.51] # each player's own period, seconds
STRETCH = 1.03
NOISE_MS = 2.0
def run(seed=0):
rng = np.random.default_rng(seed)
lab = labs.Lab()
sc, ph = P.tune_score()
pf = P.perform(sc, ph, weights=WEIGHTS, k=K)
dev, vel = P.deviations(pf, sc)
lab.row("the Tune: seconds as written / performed", f"{P.deadpan(sc)[-1]['t'] + P.deadpan(sc)[-1]['dur']:.1f} / {pf[-1]['t'] + pf[-1]['dur']:.1f}")
lab.row("longest note against written; velocity range", f"{max(dev):.2f}; {min(vel):.2f} to {max(vel):.2f}")
a = sum(ALPHAS)
r = P.phase_correction(ALPHAS, n=64, period=TEMPOS, rng=np.random.default_rng(seed))
asy = 1000 * r["asynchrony"][:, 1]
lab.row("duo: total correction; exact spread if tempos were equal (ms)", f"{a:.2f}; " + ("unstable" if not 0 < a < 2 else f"{np.sqrt(P.asynchrony_variance(a)) * 1000:.1f}"))
lab.row("duo: asynchrony after 64 beats (ms)", f"{asy[-1]:.0f}")
sc2, ph2 = sc, ph
pianists = {i: P.play(P.pianist(i), sc2, ph2) for i in range(8)}
curves = {f"pianist {chr(65 + i)}": P.tempo_curve(p) for i, p in pianists.items()}
src = pianists[int(rng.integers(8))]
fake = [{**p, "t": float(p["t"] * STRETCH + rng.normal(0, NOISE_MS / 1000))} for p in src]
fake[0]["t"] = 0.0
rank = P.identify(curves, P.tempo_curve(fake))
assert rank[0][1] >= rank[-1][1]
lab.row("the fake release: best match, then the runner-up (correlations)", f"{rank[0][0]} {rank[0][1]:.4f}; {rank[1][0]} {rank[1][1]:.3f}")
# sound: the performed Tune's first two phrases; ear problem: duos with random corrections
sub, sph = C.sub([0, 1])
parts = [C.render(P.perform(sub, sph, weights=WEIGHTS, k=K), sub, sph)]
kinds = []
for i, tot in enumerate(rng.permutation([0.0, 0.5, 2.2])):
tot = float(tot)
rr = P.phase_correction([tot / 2, tot / 2], n=20, period=[0.5, 0.512], rng=np.random.default_rng(seed + i))
parts.append(C.duo_clip(rr["onsets"]))
kinds.append({0.0: "drifts (0)", 0.5: "holds (0.5)", 2.2: "shakes (2.2)"}[tot])
lab.audio = concat(parts, gap=1.0)
lab.row("ear problem: each duo, in order (listen first)", ", ".join(kinds))
fig, (ax1, ax2) = labs.figure(2)
ax1.bar(range(len(dev)), np.array(dev) - 1, color=labs.GOLD)
ax1.set_title("each note's length against written (0 = as written)")
ax1.set_xlabel("note")
ax2.plot(asy, "o-", color="C0", ms=3)
ax2.axhline(0, color="#8A93A0", lw=0.8)
ax2.set_title(f"duo asynchrony, total correction {a:.2f}")
ax2.set_xlabel("beat")
ax2.set_ylabel("ms")
lab.fig = fig
lab.note = ("Rules stretch and weight notes; a duo's asynchrony shrinks by 1 - (alpha1 + alpha2) a beat, so it holds "
"only for totals between 0 and 2; and a time-stretched copy keeps its source's tempo curve exactly.")
return lab
Now change it
- Edit WEIGHTS and K. Which rule, turned up alone, most changes the total length? Which can you hear most clearly?
- Set ALPHAS (each player's correction) and TEMPOS. Find the largest total correction that still holds together.
- Change STRETCH and NOISE_MS for the fake release. How much editing noise hides a copy from the correlation test?
Problems, with solutions
Try each problem before opening its solution.
-
Compute. A ritardando falls to half tempo with q = 2. At what point of it is the tempo 0.8?
Solution
v² = 1 + (w² − 1)x = 1 − 0.75x. Setting v = 0.8 gives 0.64 = 1 − 0.75x, so x = 0.48: just before halfway, the tempo has lost only a fifth; the rest of the slowing comes late.
-
Prove. Prove that a duo's asynchrony has variance 2σ_T²/(1 − b²) + 4σ_M²/(1 + b), with b = 1 − α₁ − α₂.
Solution
Subtracting the two players' updates gives A_{k+1} = b A_k + (T₂ − T₁) + (M₂,ₖ₊₁ − M₂,ₖ) − (M₁,ₖ₊₁ − M₁,ₖ). The timekeeper part is white with variance 2σ_T², so it contributes 2σ_T²/(1 − b²). The motor part is u_{k+1} − u_k with u = M₂ − M₁ of variance 2σ_M²: an ARMA(1, 1) with θ = 1, whose variance is 2σ_M²(1 + 1 − 2b)/(1 − b²) = 4σ_M²/(1 + b). The two parts are independent, so the variances add. Both are finite only for |b| < 1, that is 0 < α₁ + α₂ < 2.
-
Ear. The lab plays duos with random corrections; say which drift, which hold, which shake.
Solution
The lab prints them. A drifting duo's two notes separate steadily into a flam and then an echo; a holding duo stays a single sound with a slight smear; a shaking duo alternates which player is ahead, more each beat.
-
Build. Write a rule of your own (for example "faster uphill") and hear it on the Tune.
Where to look. A rule in
perform.pyis a function of the score and phrases returning per-notestretchandvel; add it toRULESand toWEIGHTSin the lab. "Faster uphill" shortens notes that rise from the previous one by a few per cent. -
★ Is an interpretation a measurable object?
Where the frontier is. Align many recordings of one piece to the score; model each tempo curve as the structure's prediction plus a residual; ask blind listeners which recordings share an interpretation; test whether residuals cluster as listeners do, and whether a model conditioned on a cluster can reproduce it.
Notes and sources
Sources
- C. E. Seashore, Psychology of Music (1938); A. Gabrielsson, "Music performance research at the millennium", Psychology of Music (2003).
- A. Friberg, R. Bresin and J. Sundberg, "Overview of the KTH rule system for musical performance", Advances in Cognitive Psychology (2006); A. Friberg and J. Sundberg, "Does music performance allude to locomotion? A model of final ritardandi derived from measurements of stopping runners", JASA (1999); N. P. M. Todd, "The dynamics of dynamics", JASA (1992); G. Widmer, "Machine discoveries: a few simple, robust local expression principles", JNMR (2002).
- B. H. Repp, "Diversity and commonality in music performance: an analysis of timing microstructure in Schumann's Träumerei", JASA (1992); B. H. Repp, "Acoustics, perception, and production of legato articulation on a computer-controlled grand piano", JASA (1997); B. H. Repp, "Sensorimotor synchronization: a review of the tapping literature" (2005) and B. H. Repp and Y.-H. Su (2013).
- E. Shonle and K. E. Horan, "The pitch of vibrato tones", JASA (1980).
- D. Vorberg and A. M. Wing, "Modeling variability and dependence in timing" (1996); A. M. Wing, S. Endo, A. Bradbury and D. Vorberg, "Optimal feedback correction in string quartet synchronization", J. R. Soc. Interface (2014); C. Chafe, J.-P. Cáceres and M. Gurevich, "Effect of temporal separation on synchronization in rhythmic performance", Perception (2010).
- N. Cook, Beyond the Score (2013); C. S. Sapp and N. Cook on the Hatto recordings (CHARM, 2007); R. Philip, Early Recordings and Musical Style (1992).
- K. A. Ericsson, R. T. Krampe and C. Tesch-Römer, "The role of deliberate practice in the acquisition of expert performance", Psychological Review (1993); B. N. Macnamara, D. Z. Hambrick and F. L. Oswald, "Deliberate practice and performance in music, games, sports, education, and professions: a meta-analysis", Psychological Science (2014).
- C. Hawthorne and others, "Enabling factorized piano music modeling and generation with the MAESTRO dataset" (2019); D. Jeong and others, "VirtuosoNet" (2019); R. B. Dannenberg, "An on-line algorithm for real-time accompaniment" (1984); C. Raphael, Music Plus One.
About this partfrom its README
Part 43 of a sixty-eight-part course in music (see the series plan and
the syllabus), the third part of Act VII, The Craft. In 2007 a critic put a celebrated pianist's CD
into a computer and the track database named another pianist: over a hundred recordings released under Joyce Hatto's
name were other people's, and timing analysis showed it, using detailed timing and corroborating audio evidence. This part asks what a
performer adds to the notes and measures it in milliseconds: rules of expression and the kinematics of slowing down,
loudness and articulation, vibrato and intonation, ensembles that stay together by correcting each other, the timing
fingerprint, and what practice, anxiety and the body have to do with it. The tools are Monochord's
(explainer/music/monochord/perform.py). Every performance heard is a model's; the pianists are model pianists; no
recording of a real performer is played, and the Hatto case is described, not heard. Published findings are the ones
listed under Sources.
- Who is playing? An ear question (three recordings: which two are one?); the Hatto affair; the plan.
- 1. What a performer adds. Seashore's "deviation from the exact"; the Tune's first two phrases written and performed, heard; the difference drawn (phrase-final notes up to 26% longer; loudness arched); what a performer controls; Repp's 28 Träumerei recordings.
- 2. Rules of expression. The KTH rule system; each of five rules alone, heard; how rules combine; all five at strengths 0, 1 and 2, heard; what rules can and cannot do.
- 3. Slowing down. Runners and ritardandi (Friberg and Sundberg); the formula v(x) = [1 + (w^q − 1)x]^(1/q); three ritardandi, heard; phrase-final lengthening in speech; Todd's music as motion.
- 4. Loudness and articulation. Loudness across the whole Tune; legato, as written and staccato, heard; legato measured (Repp); touch.
- 5. Vibrato and intonation. An ear question (a 60-cent vibrato: higher, lower or the same?); rates of 3, 6 and 10 Hz, heard; vibrato in practice; intonation in practice.
- 6. Playing together. Linear phase correction (Vorberg and Wing); an ear question (three duos: which has nobody listening?), with the asynchronies drawn (264 ms behind after 24 beats with no correction; an over-correcting duo shaking apart); the spread against the total correction, exact and simulated (stable only between 0 and 2; best near 0.85); the negative mean asynchrony; what the model says.
- 7. Quartets and conductors. Wing and colleagues' two quartets; a democratic and an autocratic model quartet (spreads 31 and 31 ms), drawn and heard; the conductor; other ways to stay together.
- 8. Who is playing? A timing fingerprint; three tempo curves; the Hatto test on ten model pianists (the copy 0.9999, the pianist's own second take 0.988, others at most 0.90); performance history; caveats.
- 9. Practice and the performer's body. Deliberate practice (Ericsson and colleagues); what practice explains (about 21% in music, Macnamara and colleagues); how to practise; memory and anxiety; injury, dystonia and hearing.
- 10. Frontier: learning to perform. Performance as data (MAESTRO, ASAP); learned models of expression; machines that play along; ★ research problem: is an interpretation a measurable object?
- Variation 43, recap and problems. The Tune as written (28.8 s) and as performed (32.0 s), the differences drawn; the ledger; what we found; five problems; where it comes back; in practice; references; Part 44.
What is computed and built
python -m videos.music.music43.compute (under a minute) fills .cache/music43/.
| Item | What it computes | Checked against |
|---|---|---|
hook, identity |
model pianists' recordings; tempo curves; the copy test | a stretched copy correlates above 0.999 (tests) |
written, rules, strength |
the Tune written and performed; each rule; three strengths | phrase starts slower than middles (tests) |
ritard |
three kinematic ritardandi | v² linear for q = 2 (tests) |
artic |
legato, written, staccato | — |
vibrato, rates |
a vibrato tone's mean pitch; three rates | the spectral centroid at 440 Hz (tests) |
duo, duo_curve |
three duos; the spread against the correction | the closed form against 20,000 simulated beats (tests) |
quartet |
two model quartets, simulated and heard | equal spreads (tests) |
tune, variation |
Variation 43 | the ledger (tests) |
Monochord's tools are held in tests/music/test_perform.py; this part's claims and clips in tests/music/test_music43.py.
Sounds. Part 7's piano (a struck string on a soundboard) with Part 38's plucked bass, physical models; the vibrato
tones are additive, from Part 41's bowed-string spectrum (labelled synthesized). There are no recordings.
What the models are, and are not. The rules are five of the KTH system's, simplified, with our own constants. The model pianists differ by rule weights, tempo and a personal timing habit; real pianists differ in far more. The ensembles follow linear phase correction with our noise levels; the quartet matrices are ours, in the spirit of Wing and colleagues', not their estimates. Practice, anxiety and health findings are quoted from the cited studies.
Notes
All heard pianists are synthetic models; the Hatto recordings are not played. Identification uses standardized log inter-onset intervals and uniform time scaling; no universal correlation threshold proves copying. Piano controls include pedals and instrument mechanics beyond three note parameters. Vibrato center judgments depend on rate and waveform, and hertz and cent averages differ. Duo stability applies to the stated linear model; quartet stability depends on its interaction matrix. Conductors supplement listening. Practice meta-analysis reports observational explained variance, not causal shares or a limit on individual potential.
Companion material in this repository
The syllabus's plan for this partfrom SYLLABUS.md, the plan of record
- Hook: an ear question (which two recordings are one?); the Hatto affair; the plan.
- What a performer adds: Seashore; written and performed, heard; the difference drawn; what a performer controls; Repp's Träumerei.
- Rules of expression: the KTH system; five rules alone, heard; how rules combine; three strengths, heard; limits.
- Slowing down: runners and ritardandi; the kinematic formula; three ritardandi heard; speech; music as motion.
- Loudness and articulation: loudness across the Tune; legato and staccato heard; legato measured; touch.
- Vibrato and intonation: an ear question (a vibrato's pitch); three rates heard; vibrato in practice; intonation in practice.
- Playing together: phase correction; an ear question (which duo has nobody listening?); the spread and its stability bound; early on purpose; what the model says.
- Quartets and conductors: Wing and colleagues; two model quartets, drawn and heard; the conductor; other ways to stay together.
- Who is playing?: a timing fingerprint; three tempo curves; the Hatto test on model pianists; performance history; caveats.
- Practice and the performer's body: deliberate practice; what practice explains; how to practise; memory and anxiety; the body.
- Frontier: performance as data; learned models of expression; machines that play along; the research problem.
- Variation 43: the Tune as written and as performed, the differences drawn. Outro: problems, payoffs.
Covers: expressive timing and its models; dynamics; articulation; vibrato; intonation in practice; ensemble
synchronization as phase correction; the conductor; practice and what the evidence says about it; memory and
anxiety; injury and hearing.
Built and computed: monochord/perform.py: five rules after the KTH system (phrase arch, duration contrast, high
loud, punctuation, final ritardando) with strengths and weights; Friberg and Sundberg's kinematic ritardando; a vibrato
tone heard at its mean pitch; linear phase correction for duos and quartets, with the duo's variance in closed form
(stable only for 0 < α₁ + α₂ < 2; best near 0.85 for our noise), checked against simulation; model pianists and a
Hatto-style identity test on tempo curves (a time-stretched copy 0.9999, a second take 0.988, others at most 0.90).
Variation 43: the Tune as written (28.8 s) and as performed (32.0 s), phrase ends up to 26% longer, the differences
drawn.
Frontier: learned models of expression (MAESTRO, ASAP, VirtuosoNet); machine accompaniment and ensemble coordination
(open: is an interpretation a measurable object?).
Reading: Gabrielsson's reviews; Friberg, Bresin & Sundberg (2006); Wing et al. (2014); Repp's studies.
Build the film
python -m videos.music.music43.compute # the part's numbers, into .cache/music43
python tools/build.py music43 # render and assemble the film
EXPLAINER_TTS=silent python tools/qa_scene.py music43 Hook # one chapter, silent, with a contact sheet
Scenes: videos/music/music43. Setup: see the course page. Source of these notes: the README and the scenes' narration.
Build it
python -m videos.music.music43.compute # numbers and sounds (under a minute)
EXPLAINER_TTS=silent python tools/build.py music43 -q l --fps 15 # a silent-narration preview, with the sounds
python tools/qa_sound.py music43 --sync # the sound gates
python tools/dead_air.py renders/music43_480p.mp4 --sound music43 # no empty screen; no sound over a still one
python tools/lecture_length.py music43 # 30 to 60 minutes, listening included
python tools/build.py music43 # 1080p30, narrated
python -m pytest -q tests/music # Monochord against its references; this part's claims and clips
python -m videos.music.labs 43 # the lab (writes a figure and a short WAV)