20
Savant Tony Wu – Jay Ni – Deri Kusuma Automated music improvisation 1 Special Thanks to: Prof. Plummer and Cristina Pop and our testers: Tim Lambert, Adriana Miu, Jon Lau, and You Li

Savant Tony Wu – Jay Ni – Deri Kusuma Automated music improvisation 1 Special Thanks to: Prof. Plummer and Cristina Pop and our testers: Tim Lambert, Adriana

Embed Size (px)

Citation preview

Page 1: Savant Tony Wu – Jay Ni – Deri Kusuma Automated music improvisation 1 Special Thanks to: Prof. Plummer and Cristina Pop and our testers: Tim Lambert, Adriana

SavantTony Wu – Jay Ni – Deri Kusuma

Automated music improvisation

1

Special Thanks to: Prof. Plummer and Cristina Popand our testers: Tim Lambert, Adriana Miu, Jon Lau, and You Li

Page 2: Savant Tony Wu – Jay Ni – Deri Kusuma Automated music improvisation 1 Special Thanks to: Prof. Plummer and Cristina Pop and our testers: Tim Lambert, Adriana

Architecture

2

Page 3: Savant Tony Wu – Jay Ni – Deri Kusuma Automated music improvisation 1 Special Thanks to: Prof. Plummer and Cristina Pop and our testers: Tim Lambert, Adriana

Algorithms

3

Page 4: Savant Tony Wu – Jay Ni – Deri Kusuma Automated music improvisation 1 Special Thanks to: Prof. Plummer and Cristina Pop and our testers: Tim Lambert, Adriana

Music Representation

4

- Screenshot of Cakewalk Music Creator 3

Note

Time

Pitch

Page 5: Savant Tony Wu – Jay Ni – Deri Kusuma Automated music improvisation 1 Special Thanks to: Prof. Plummer and Cristina Pop and our testers: Tim Lambert, Adriana

Note Representation

5Struck time

Pitch

Release time

Velocity = struck volume

Time

Volume (db)

Page 6: Savant Tony Wu – Jay Ni – Deri Kusuma Automated music improvisation 1 Special Thanks to: Prof. Plummer and Cristina Pop and our testers: Tim Lambert, Adriana

Music Timing

6

=120

@ 120 beats per minute

1 tick ≈ 125 ms

1 beat ≈ 0.5 sec

1 measure

Tempo (beats per minute)

@ 4 ticks per beat

Page 7: Savant Tony Wu – Jay Ni – Deri Kusuma Automated music improvisation 1 Special Thanks to: Prof. Plummer and Cristina Pop and our testers: Tim Lambert, Adriana

Logic

Architecture

7

GUI

Input buffer

Libraries and intermediate data structures

Output buffer

MIDI controllerMIDI input file

Input manager

Decision Engines

Analyzers

Improvisers

Output manager

Synthesizer

MIDI output file

Logic threadInput thread

Output thread

Visualization

Audible sound

GU

I thr

ead

Page 8: Savant Tony Wu – Jay Ni – Deri Kusuma Automated music improvisation 1 Special Thanks to: Prof. Plummer and Cristina Pop and our testers: Tim Lambert, Adriana

Real-time Music Storage

8

Circular chunklistPress note O(1)

Release note O(1)

Range query O(A + n)

Time overhead O(n) per tick

Memory usage O(NL)

A: number of answersn: avg. number of notes per tickN: total number of notes storedL: avg. length of notes in tick

Page 9: Savant Tony Wu – Jay Ni – Deri Kusuma Automated music improvisation 1 Special Thanks to: Prof. Plummer and Cristina Pop and our testers: Tim Lambert, Adriana

Chord analysis – basic chord types

9

These are like basic colors in painting

Other chords are simply enrichment / inversion / transposition of these basic feels

major minor dim aug dom half dim sus4C:

Enrichment Inversion Transposition (of C major)

Page 10: Savant Tony Wu – Jay Ni – Deri Kusuma Automated music improvisation 1 Special Thanks to: Prof. Plummer and Cristina Pop and our testers: Tim Lambert, Adriana

Chord analysis – note domains

10

Important for generation!

C: I d: VIIb G: IVAffinity to A, B

Distance from F, Ab Affinity to F, Ab Affinity to F#

These are all C major chords:

Page 11: Savant Tony Wu – Jay Ni – Deri Kusuma Automated music improvisation 1 Special Thanks to: Prof. Plummer and Cristina Pop and our testers: Tim Lambert, Adriana

Chord Analysis – Note Desirability

11

C major: Only C,E,G will sound good down here

F and F# only sound good with

high octaves

D,A,B sound good if not too

low

Higher pitch has less chord determining

capability

Page 12: Savant Tony Wu – Jay Ni – Deri Kusuma Automated music improvisation 1 Special Thanks to: Prof. Plummer and Cristina Pop and our testers: Tim Lambert, Adriana

Chord Analysis – Capturing Richness

12

G dominant 7 b9 b13G

F

B

EbAb

Bass

Strong notes

Higher notes

Storing the note distribution of input captures richness beyond basic types (e.g. major, minor)

C, Db, D, E, F#, A, Bb Absent

Page 13: Savant Tony Wu – Jay Ni – Deri Kusuma Automated music improvisation 1 Special Thanks to: Prof. Plummer and Cristina Pop and our testers: Tim Lambert, Adriana

Chord Analysis – Capturing Ambiguity

13

We compute a score for each possible chord interpretation, and then pick the

highest score to determine chord.

C Db D Eb E F F# G Ab A Bb B

M .93 … … … … .50 … … … … … …

m .47 … … … … … … … … .70 … …

dim -.44 … … … … … … … … .34 … …

aug -.76 … … … … … … … … … … …

dom .23 … … … … … … … … … … …

halfdim -.45 … … … … … … … … .48 … …

… … … … … … … … … … … … …

Page 14: Savant Tony Wu – Jay Ni – Deri Kusuma Automated music improvisation 1 Special Thanks to: Prof. Plummer and Cristina Pop and our testers: Tim Lambert, Adriana

Decoupling Motif and Chord

14

C major

G 7

+

+

+ Bb minor 7 9 / F

=

=

=The same motif

Page 15: Savant Tony Wu – Jay Ni – Deri Kusuma Automated music improvisation 1 Special Thanks to: Prof. Plummer and Cristina Pop and our testers: Tim Lambert, Adriana

Offline Motif Fitting

15

CBBbAAbGF#FEEbDDbCBBbAAbGF#FEEbDDbC

One-to-one pitch mapping algorithmwith dynamic programming Maximize objective

function:

REWARDchordal fitness as a function of motif and destination chord

PENALTYabsolute displacement ,relative displacement

TIME BUDGET60-120 ms per motif

Page 16: Savant Tony Wu – Jay Ni – Deri Kusuma Automated music improvisation 1 Special Thanks to: Prof. Plummer and Cristina Pop and our testers: Tim Lambert, Adriana

Real-time Motif Fitting

16

Pitch

Time

Maximize objective function per assignment, given assistance level

REWARDchordal fitness as a function of destination chord,consistency to assignment history

PENALTYabsolute displacement,collision with assignment history for neighboring notes

TIME BUDGET< 1 ms per note

The present

input

mapped

Page 17: Savant Tony Wu – Jay Ni – Deri Kusuma Automated music improvisation 1 Special Thanks to: Prof. Plummer and Cristina Pop and our testers: Tim Lambert, Adriana

Determining Key of Piece

17

HOW?The current key is determined by the discrete convolution of the input notes with each major / minor filter.

Performing Key Changes• Abrupt: Using dominant chord of new tonic• Smooth: Leverage current chord progression

C: I – V – vi – iii – F:I – V – vi - … (C:IV – I – ii - …)

Page 18: Savant Tony Wu – Jay Ni – Deri Kusuma Automated music improvisation 1 Special Thanks to: Prof. Plummer and Cristina Pop and our testers: Tim Lambert, Adriana

Pleasant Chord Transitions

18

Chord State Machine Chord type heuristic

I M, M7, M9

II m7

III m, D7

IV M, M7, m

V D7

VI m, m7

VII dim, dim7, halfdim7

(From music theory)

Page 19: Savant Tony Wu – Jay Ni – Deri Kusuma Automated music improvisation 1 Special Thanks to: Prof. Plummer and Cristina Pop and our testers: Tim Lambert, Adriana

Chord Phrasing

19

Forcing a phrase to end in a chord (e.g. V7) produces clearer phrase boundaries.

C: I – iii – vi – IV – ii – V7 – I – V7

If this isn’t possible…

C: I – iii – vi – IV – ii – I – iii – V7

Take 2 steps back!

C: I – iii – vi – IV – ii – – – V7

Page 20: Savant Tony Wu – Jay Ni – Deri Kusuma Automated music improvisation 1 Special Thanks to: Prof. Plummer and Cristina Pop and our testers: Tim Lambert, Adriana

Savant Modes

20

Mode Description

Co-op Duet with human on harmony, human on melody. Melody is fitted to match the harmonic progression.

AI Co-op Duet with AI on harmony, human on melody. Melody is fitted to match the harmonic progression.

Remix Analyzes motif and chords of input, and generates a remixed version with motif and chord substitutes. User can play along and choose to influence direction of generation, or to have input fitted to chord progression.

Call & Response User plays a musical phrase, and computer will respond with an equal length phrase.

Empty No logic, just like a real piano!