Вы находитесь на странице: 1из 43

Music Theory and Performance Analysis with Sebastian and Czerny

James Tauber @jtauber

The Idea The Components


Sebastian

The Score The Performance The Recording

Lilypond Czerny MIDI

WAV

Sebastian

Mathematical: Symbolic more than Numerical

Modeling Music
repetitive hierarchical sequential + parallel factorable underspecified

Point of Departure
{ {OFFSET: 0, PITCH: 37, DURATION: 16}, {OFFSET: 16, PITCH: 21, DURATION: 8} }

or
[ {PITCH: 3, OCTAVE: 5, DURATION: 16}, {PITCH: 2, OCTAVE: 4, DURATION: 8} ]

Three Blind Mice


mice = (seq1 * 2) + (seq2 + seq2a) + (seq2 + seq2b) + ((seq3 + seq3a) * 2) + (seq3 + seq3b) + seq1

Three Types of Sequence


HSeq Horizontal / Sequential VSeq Vertical / Parallel OSeq Offset-based

HSeq
each element follows the previous concatenate(next_seq) repeat(count) __add__ __mul__

A = B * 2 + C

VSeq
each element is coincident merge(parallel_seq) __floordiv__

A = B // C

OSeq
factory function that returns a class using the given offset attribute and duration attribute def OSeq(offset_attr, duration_attr) has operators of both HSeq and VSeq

All Sequences
__init__(*elements) __getitem__ & __len__ __eq__ & __ne__ transform(func) __or__

A = B | transpose(5) | reverse()

Three Types of Sequence


HSeq Horizontal / Sequential VSeq Vertical / Parallel OSeq Offset-based

Points
handling underspecification with dictionaries unify(other) __mod__

{PITCH: 3, OCTAVE: 4} % {DURATION: 16}

Pitch
note names t wo numbers or one? MIDI pitch Hewletts base-40 system my own system just have transforms for conversion

Taubers Pitch System


D is 0 and each successor is a fifth higher modulo octave (e.g. A is 1, G is -1) semitone above is x-5 augment (semitone above, same letter) is x+7 modifiers: ((val+3)-((val+3)%7))/7 major scale: [tonic + i for i in [0, 2, 4, -1, 1, 3, 5]]

Lilypond
from sebastian.lilypond.interp import parse ! seq1 = parse("e4. d c r") seq2 = parse("g4. f4 f8 e4.") seq2a = parse("r4.") seq2b = parse("r4 g8") seq3 = parse("c'4 c'8 b a b c'4 g8 g4") seq3a = parse("g8") seq3b = parse("f8")

Lilypond
seq1 = parse("e4. d c r")

[{'midi_pitch': 52, 'offset_64': 0, 'duration_64': 24}, {'midi_pitch': 50, 'offset_64': 24, 'duration_64': 24}, {'midi_pitch': 48, 'offset_64': 48, 'duration_64': 24}, {'offset_64': 96}]

MIDI
library for parsing and generating MIDI files
from sebastian.midi import write_midi ! write_midi.write("mice.mid", [mice])

Alberti
common classical figuration of a triad a function from a triad to a sequence of notes great example of factorization and underspecification

Alberti
def alberti(triad): return HSeq([ triad[0], triad[2], triad[1], triad[2] ])

Alberti
root_triad = VSeq( Point(degree=1), Point(degree=3), Point(degree=5)) ! quaver = Point({DURATION_64: 8}) ! alberti_seq = OSequence( alberti(root_triad) * 16 | add(quaver) )

Alberti
C_major = Key("C", major_scale) ! seq = alberti_seq | degree_in_key_with_octave(C_major, 5) | midi_pitch() ! write_midi.write("alberti.mid", [seq])

Whats Next?
a lot more examples better use of MIDI input control over instruments in MIDI output nesting of sequences (for hierarchy) the notion of a head point

Sebastian

github.com/ jtauber/ sebastian

Czerny

Whats the Difference bet ween the Score and the Performance

Positive vs Negative Differences


study expression the performer is adding what errors were made? what inconsistencies or unevenness?

Representing the Performance


a sequence of events MIDI?

Representing the Score


just another sequence of events but this time desired events and with less information

C major scale
ascending then descending over one octave represent as sequence of note + duration
60 62 64 65 67 69 71 72 71 69 67 65 64 62 60 8 4 4 4 4 4 4 8 4 4 4 4 4 4 8

MIDI Performance
4d54 726b 6c74 6961 0800 00ff 3a2c 9040 812d 473b 0b90 433d 2c90 3081 ff2f 6864 0000 00ff 6e6f ff59 5103 903c 001f 9043 814b 473b 0490 4100 1490 00 0000 00cd 0413 2048 0200 07a1 0081 9041 002a 9047 8148 4500 2090 3e00 0006 00ff 5374 616c 0000 2089 3290 4181 9045 0018 9047 8132 4038 4190 0000 0308 6569 6c00 ff54 6d90 3e00 3e90 4d81 9048 0006 9043 810e 3c42 0001 2364 6e77 ff58 0521 3c4f 0390 4100 2090 5583 9045 0022 9040 831c 01e0 6566 6179 0404 0000 832b 403f 0790 4500 2690 3b81 9041 0035 903c 4d54 6175 2050 0218 0000 903e 8137 4344 2690 4800 5990 3981 903e 0000

Performance Events
offset in ticks MIDI pitch velocity 0 velocity indicates note off
1261 1688 1732 1910 1913 2096 2127 2317 2324 2497 2539 2699 2737 2940 2964 3386 ... 60 62 60 62 64 64 65 65 67 67 69 69 71 71 72 72 79 58 0 0 63 0 65 0 68 0 77 0 59 0 85 0

Performance Events
convert from note start + note end to just start + duration
1261 1688 1913 2127 2324 2539 2737 2964 3397 3603 3820 4036 4240 4435 4648 60 62 64 65 67 69 71 72 71 69 67 65 64 62 60 79 58 63 65 68 77 59 85 59 59 61 57 56 48 66 471 222 183 190 173 160 203 422 200 221 182 172 142 148 412

We Want to Diff
60 62 64 65 67 69 71 72 71 69 67 65 64 62 60 8 4 4 4 4 4 4 8 4 4 4 4 4 4 8 1261 1688 1913 2127 2324 2539 2737 2964 3397 3603 3820 4036 4240 4435 4648 60 62 64 65 67 69 71 72 71 69 67 65 64 62 60 79 58 63 65 68 77 59 85 59 59 61 57 56 48 66 471 222 183 190 173 160 203 422 200 221 182 172 142 148 412

vs

Want to Diff
to diff, you must first align alignment is a dynamic programming problem generally relying on notion of scoring the relative cost of adding, deletion or changing items the change score can be very domain specific Needleman-Wunsch algorithm

Change Score
just consider note value: +1 if same, 0 if different or: +1 if same, +0.5 if a tone or semitone apart, 0 if more duration? wrong octave?

Result
((60, ((62, ((64, ((65, ((67, ((69, ((71, ((72, ((71, ((69, ((67, ((65, ((64, ((62, ((60, 8), 4), 4), 4), 4), 4), 4), 8), 4), 4), 4), 4), 4), 4), 4), (1261, (1688, (1913, (2127, (2324, (2539, (2737, (2964, (3397, (3603, (3820, (4036, (4240, (4435, (4648, 60, 62, 64, 65, 67, 69, 71, 72, 71, 69, 67, 65, 64, 62, 60, 79, 58, 63, 65, 68, 77, 59, 85, 59, 59, 61, 57, 56, 48, 66, 471)) 222)) 183)) 190)) 173)) 160)) 203)) 422)) 200)) 221)) 182)) 172)) 142)) 148)) 412))

Visualizing Mistakes

Czerny

github.com/ jtauber/ czerny

Music Theory and Performance Analysis with Sebastian and Czerny


James Tauber @jtauber

Вам также может понравиться