Music Informatics Alan Smaill Jan 21 2014 Alan Smaill Music - - PowerPoint PPT Presentation

music informatics
SMART_READER_LITE
LIVE PREVIEW

Music Informatics Alan Smaill Jan 21 2014 Alan Smaill Music - - PowerPoint PPT Presentation

N I V E U R S E I H T T Y O H F G R E U D I B N Music Informatics Alan Smaill Jan 21 2014 Alan Smaill Music Informatics Jan 21 2014 1/24 Today N I V E U R S E I H T T Y O H F G R E U D I B N


slide-1
SLIDE 1

T H E U N I V E R S I T Y O F E D I N B U R G H

Music Informatics

Alan Smaill Jan 21 2014

Alan Smaill Music Informatics Jan 21 2014 1/24

slide-2
SLIDE 2

T H E U N I V E R S I T Y O F E D I N B U R G H

Today

More on Midi vs wav representation. Basic music parameters Rhythmic and metrical analysis

Alan Smaill Music Informatics Jan 21 2014 2/24

slide-3
SLIDE 3

T H E U N I V E R S I T Y O F E D I N B U R G H

midi and wav again

Recall difference between procedural midi representation (key press and time based), and digital versions of sound wave

  • representations. There is a trade-off between the expressiveness

(the fine details of performance) and manipulability (allowing abstract analysis).

Alan Smaill Music Informatics Jan 21 2014 3/24

slide-4
SLIDE 4

T H E U N I V E R S I T Y O F E D I N B U R G H

Comparing representations

There are obvious strengths and weaknesses between these different representations; consider some musical manipulations that musicians do fairly often on the basis of listening to another musician: Task midi wav copy ✘ ✔ keep melody, change instrument ✔ ✘ add echo ? ? generate score ✔? ✘ transpose, same tempo ✔ ✔?

Alan Smaill Music Informatics Jan 21 2014 4/24

slide-5
SLIDE 5

T H E U N I V E R S I T Y O F E D I N B U R G H

midi to wav/mp3

This is one of the main uses of midi, and is supported by many tools. midi files indicate orchestration for each channel as a “Program change” message; the resultant sounds depend on the quality of an associated synthesiser. The standard specifies timbres in terms of common musical terms (eg as a vibraphone note). Compare sound output direct from such a midi synthesiser, and via digital or acoustic piano: http://www.piano-midi.de/ It’s easy to get the notes played by (something sounding like) other instruments.

Alan Smaill Music Informatics Jan 21 2014 5/24

slide-6
SLIDE 6

T H E U N I V E R S I T Y O F E D I N B U R G H

wav to midi

As we expect, this is much harder; midi files are much much smaller than audio, giving a view of the sounds that is biased by the discrete pitch set in the standard use of midi. A small example that just about succeeds in doing this is at: http://www.pluto.dti.ne.jp/~araki/amazingmidi/ This is polyphonic music (ie several notes are played at the same time), but it’s on an instrument that only makes notes at semi-tone

  • intervals. As the site says, this is harder with sung music. Even
  • ne solo voice is hard; in that case we can track pitch fairly well,

but the mapping from pitch to midi note can get misled very easily.

Alan Smaill Music Informatics Jan 21 2014 6/24

slide-7
SLIDE 7

T H E U N I V E R S I T Y O F E D I N B U R G H

Metrical analysis

We’ll now consider the temporal organisation of music. In particular, we’ll take a first look at metrical organisation as mostly used in western tonal music. This is characterised by a regular underlying pulse a regular hierarchical grouping (and/or subdivision) of pulses in groups of 2, 3 or 4 Most people can pick up on dance rhythms, and recognise say the regular 3 pulses in a bar (measure) in a waltz.

Alan Smaill Music Informatics Jan 21 2014 7/24

slide-8
SLIDE 8

T H E U N I V E R S I T Y O F E D I N B U R G H

Example

Music given a time signature of 6/8 has three levels of grouping, the underlying quaver (eighth not) being grouped in threes, in turn being grouped in twos. Depending on how fast the music is, the listener may tap along at any of these levels – the level at which the pulse is sensed is called the tactus.

bar : x | x | mid : x x | x x | lowest : x x x x x x | x x x x x x |

Here we distinguish between rhythm, as in a (short) sequence of

  • rganised duration, and metrical structure which involves longer

scale setting up of expectations of hierarchical layers.

Alan Smaill Music Informatics Jan 21 2014 8/24

slide-9
SLIDE 9

T H E U N I V E R S I T Y O F E D I N B U R G H

Metre and notes

Note that this underlying framework can be part of the

  • rganisation even when the notes played do not coincide with the

beginning of the metrical units (as in syncopated music). This

  • rganisation is also heard to persist even during a slowing down or

speeding up of the underlying pulse. For a lengthier account of the issues, see for example in pp 22-26, Scruton, Aesthetics of Music, OUP, 1997. Scruton points out that the German philosopher Leibniz described music as “a kind of unconscious calculation”: the beat is thus measured out, during the stretching and contraction of time found especially in romantic music of the 19th century (rubato).

Alan Smaill Music Informatics Jan 21 2014 9/24

slide-10
SLIDE 10

T H E U N I V E R S I T Y O F E D I N B U R G H

Recognising metre by machine

All this suggests that it is a hard task to analyse metrical structure by computer, even under the simplifying assumptions made so far. Notice that the task involves a cognitive dimension: how is the metre experienced? And the answer is probably different for different people. However, to create a good test situation we can follow Longuet-Higgins (Mental Processes, MIT Press, 1987), and take a situation where there is a score, so that: we know the composer’s own specification there is a single line of music the music involves little or no differentiation in volume (no strong accents)

Alan Smaill Music Informatics Jan 21 2014 10/24

slide-11
SLIDE 11

T H E U N I V E R S I T Y O F E D I N B U R G H

Rhythmic analysis of Bach Fugues

Longuet-Higgins (and Steedman) looked at analysing the metre from the initial statement of the fugues from Bach’s 48 Preludes and Fugues. At that point of each piece, there is only a single line being played; these were played on early keyboard instruments

  • riginally (clavichord, which does not have a big dynamic range, &

harpsichord where the volume is fixed). To further simplify, take as input a sequence of durations as multiples of an appropriate unit of time. This means that it is given in the input that the semiquaver is half the length of the quaver, for example. But no information about the time signature

  • r bar-lines is given.

Alan Smaill Music Informatics Jan 21 2014 11/24

slide-12
SLIDE 12

T H E U N I V E R S I T Y O F E D I N B U R G H

Example

Bach Fugue C minor, book 1 of the 48 Subject of fugue (first two bars only 1 voice)

  • Alan Smaill

Music Informatics Jan 21 2014 12/24

slide-13
SLIDE 13

T H E U N I V E R S I T Y O F E D I N B U R G H

Basic Patterns

Some terminology, related to terms from rhythms is poetry (the names are not important here): dactyl: long, short, short (where the last short is recognised as short because another note starts quickly) spondee: long, short (not followed by another short) This is still underdefined; – for example what about lengths [4,2,1,1...]? – Is the 4,2,1 a dactyl?

Alan Smaill Music Informatics Jan 21 2014 13/24

slide-14
SLIDE 14

T H E U N I V E R S I T Y O F E D I N B U R G H

Main idea

Because these are the first notes the listener hears, and the aim is to model perception, it is expected that: the listener builds up the analysis incrementally the lower levels (shorter scale) are perceived first higher levels are built on lower levels at acceptable multiples

  • f the current level’s pulse

Alan Smaill Music Informatics Jan 21 2014 14/24

slide-15
SLIDE 15

T H E U N I V E R S I T Y O F E D I N B U R G H

Justification

Why does this make sense as a model of understanding metre? The claim is that The progressive nature of the listener’s comprehension is made explicit in an assumption about the permitted order

  • f musical events in an acceptable melody. This

assumption we call the “rules of congruence”, and it is fundamental to the operation of both our harmonic and

  • ur metrical rules.

Longuet-Higgins and Steedman, p 84 of L-H above Thus a note that fits the metre locally is congruent; a note which is stressed rhythmically by the context, but not by the local metre (syncopated) is metrically non-congruent.

Alan Smaill Music Informatics Jan 21 2014 15/24

slide-16
SLIDE 16

T H E U N I V E R S I T Y O F E D I N B U R G H

What is a good analysis?

The outcome could be any of these: time signature and bar-lines as in metrical analysis time signature and bar-lines as in metrical analysis, with grouping of bars time signature as in metrical analysis, but out of phase (eg 4/4 with bar-line displaced by half bar) metrical analysis correct but stopping beneath level of bar metrical analysis wrong at some level of the hierarchy (second better than first, if right?, others not so good, last worst)

Alan Smaill Music Informatics Jan 21 2014 16/24

slide-17
SLIDE 17

T H E U N I V E R S I T Y O F E D I N B U R G H

Algorithm: outline

Suppose we are at start of subject, or at start of current metrical unit, and first 3 notes are n1, n2, n3:

i f at s t a r t

  • f

d a c t y l i f d u r a t i o n

  • f

d a c t y l good m u l t i p l e

  • f

c u r r e n t u n i t adopt d u r a t i o n as h i g h e r m e t r i c a l u n i t e l s e i f l e n n1 − ( l e n n2 + l e n n3 ) good m u l t i p l e adopt t h i s leng th as h i g h e r m e t r i c a l u n i t i f at s t a r t

  • f

spondee i f l e n n1 − l e n n2 i s good m u l t i p l e adopt t h i s as h i g h e r m e t r i c a l l e v e l i f n e i t h e r

  • f

above , & f i r s t note l a s t s n c u r r e n t m e t r i c a l u n i t s i f n i s good m u l t i p l e adopt t h i s as h i g h e r m e t r i c a l l e v e l

  • therwise

keep c u r r e n t m e t r i c a l a n a l y s i s , and move to next p u l s e at t h i s l e v e l .

Alan Smaill Music Informatics Jan 21 2014 17/24

slide-18
SLIDE 18

T H E U N I V E R S I T Y O F E D I N B U R G H

Algorithm ctd

Look at fugue 2, book 1, (C minor). The input is: [1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 1, 1, 2, 2, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1]

* First note: establish 1 as initial length * Note 2 conforms * Note 3 doubles length, and starts new metrical level * Note 5 is start of dactyl; double length, start new level

Note that the crotchet (4) does not disturb this analysis, because it is not at the start of a pulse at the established level. So analysis here gives:

nts: x x x x x x x x x x x x x x x x x x x x l1: x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x l2: x x x x x x x x x x x x x x x l3: x x x x x x x

Alan Smaill Music Informatics Jan 21 2014 18/24

slide-19
SLIDE 19

T H E U N I V E R S I T Y O F E D I N B U R G H

Going a bit further

The algorithm so far does not go higher in the hierarchy. But listeners do hear at least another level. A further stage involves marking metrical units themselves, and not just individual notes. Say a unit is marked for accent if a note

  • r dactyl starts at the beginning, and lasts throughout the unit.

Now use the “isolated accent rule”:

i f a u n i t i s marked f o r accent and i s f o l l o w e d by 1 or more unmarked u n i t s which are f o l l o w e d by a marked u n i t which i s f o l l o w e d by an unmarked u n i t then the i n t e r v a l between s t a r t

  • f

marked u n i t s forms a new l e v e l in the m e t r i c a l h i e r a r c h y

Alan Smaill Music Informatics Jan 21 2014 19/24

slide-20
SLIDE 20

T H E U N I V E R S I T Y O F E D I N B U R G H

Using isolated accent rule

In the fugue at hand, the isolated accent rule applies between notes number 5 (start of [2,1,1]) and and 10 (another [2,1,1]) and this establishes metrical level of minim (the half bar level in Bach’s notation). Units marked for accent marked by A:

nts: x x x x x x x x x x x x x x x x x x x x l1: x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x l2: x x x x x x x x x x x x x x x l3: x x x x x x x A A

Alan Smaill Music Informatics Jan 21 2014 20/24

slide-21
SLIDE 21

T H E U N I V E R S I T Y O F E D I N B U R G H

Going a bit further

The new analysis:

nts: x x x x x x x x x x x x x x x x x x x x l1: x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x l2: x x x x x x x x x x x x x x x l3: x x x x x x x l4: x x x x

This is a reasonable final analysis, though it is at the half-bar level.

Alan Smaill Music Informatics Jan 21 2014 21/24

slide-22
SLIDE 22

T H E U N I V E R S I T Y O F E D I N B U R G H

Starting elsewhere

Notice that if we take the input starting later, we can get a different analysis. Suppose we start as follows:

  • Now the “off-beat” dactyl is heard before the higher level is

established, so we get a contradictory analysis at level 3 (l3).

nts: x x x x x x x x x x x x x x x x x x l1: x x x x x x x x x x x x x x x l2: x x x x x x x l3: x x x

Alan Smaill Music Informatics Jan 21 2014 22/24

slide-23
SLIDE 23

T H E U N I V E R S I T Y O F E D I N B U R G H

Overall success on Back examples

This algorithm was run on the 48 examples in Bach’s 48 preludes and fugues. Mostly analysis is correct, stopping at at sub-bar level. Sometimes gets Bach’s given metre, or grouping of bars. Some “interesting mistakes”.

Alan Smaill Music Informatics Jan 21 2014 23/24

slide-24
SLIDE 24

T H E U N I V E R S I T Y O F E D I N B U R G H

Metrical ambiguity

The algorithm can be seen as a way to parse a particular sort of metrical structure. It does not allow ambiguity, but sticks with an initial analysis, even when later evidence mounts up against this. The algorithm can be extended to maintain different metrical hypotheses, where one wins out, perhaps displacing earlier leading candidates.

Alan Smaill Music Informatics Jan 21 2014 24/24

slide-25
SLIDE 25

T H E U N I V E R S I T Y O F E D I N B U R G H

In an English Country Garden

This is analogous to “garden path” sentences in natural language, where parts of sentences are understood one way during incremental analysis, only for that analysis to be discarded later on when more information is available. Compare: The man who hunts ducks . . . completed as . . . The man who hunts ducks out on weekends. The deliberate play on metrical (and other sorts of) ambiguity in music is more prevalent in music than in natural language, and is part of what makes music interesting (and difficult to process by machine).

Alan Smaill Music Informatics Jan 21 2014 25/24

slide-26
SLIDE 26

T H E U N I V E R S I T Y O F E D I N B U R G H

Metrical garden paths

For an example where the initial metrical analysis is contradicted by subsequent rhythmic input, look at paper by Peter Vazan, Michael F. Schober, “Detecting and resolving metrical ambiguity in a rock song upon multiple rehearing”. http://www.icmpc8.umn.edu/proceedings/ICMPC8/PDF/ AUTHOR/MP040242.PDF

Alan Smaill Music Informatics Jan 21 2014 26/24

slide-27
SLIDE 27

T H E U N I V E R S I T Y O F E D I N B U R G H

Overlaying different metrical patterns?

Some other problems in metrical analysis are illustrated by the following example from Ravel, with simultaneous presence of different temporal organisations. How could adapt the earlier ideas to analyse music like this? Listen to repeated pattern of four equal notes at the start of Ravel’s “Rapsodie Espagnole”. Now listen on, and note the time signature which is not what the listener expects from hearing the initial section of music.

Alan Smaill Music Informatics Jan 21 2014 27/24

slide-28
SLIDE 28

T H E U N I V E R S I T Y O F E D I N B U R G H

More metrical ambiguity

  • p
  • 4

3

  • 4

3 4 3 4 3

  • ppp
  • p
  • p
  • 5
  • pp
  • p
  • p
  • Alan Smaill

Music Informatics Jan 21 2014 28/24

slide-29
SLIDE 29

T H E U N I V E R S I T Y O F E D I N B U R G H

Summary

Converting between representations. Metrical organisation in WTM Metrical “parsing” and metrical ambiguity.

Alan Smaill Music Informatics Jan 21 2014 29/24