Sunteți pe pagina 1din 31

Trends in Answer-SetProgramming Focus: Music

Erhard Dinhobl

Roadmap
Motivation: Why Automatic Composition? Basics in Music ANTON and Music Basics in Answer-Set-Programming ANTON and Answer-Set-Programming

Conclusion

Why Automatic Composition


Is it possible? With ANTON, yes melodic and harmonic composition tool ANTON uses declarative programming language for rules representation helps composers to understand and detect failures

Basics
Harmony underlying sound of a melody functional parameter, the chord structure define harmonic progress (history, new melody) i.e. cadences Melody progress of notes over time what we sing

Basics - Genre
style of music different rules (added to fundamental music) characteristics, culture, instruments, way we hear western tonality halftone music interval structure smaller Arabianclassic, quarter-tone, microtonal BUT: blues (quint in between #11 and 5)

System ANTON
minimal set of rules to generate/verify music adding rules improvement of quality Computer-Aided Composition Background music Elevators, Halls,

Compositionprocess I
global structure (AABA, Etude, Minuet, ) melody (not overall, variations, J.S.Bach Invetionen, W.A.Mozart Twinkle Twinkle Little Star) question: where is the next note? example: Musikalisches Wrfelspiel approved: mathematic models, fractals, chaos processes, Markov-chains

Compostionprocess II
David Cope The Algorithmic Composer Iannis Xenakis (example: Modulor) my work Ursprungskunst generate music out of architecture and the other way ornaments (Claude Debussy, Morton Feldmann)

Composition III
alternative: IRCAM (based on PWConstraints-addon LISP and graphic lang.) composition also in improvisation music (jazz, baroque figured bass notation) jazz musicians improvise over accord structure a standard Improvisation system Composition system

Answer-Set-Programming I
formal defined rules r: a1,, aj b1,, bm, not bm+1,, not bn H(r) = head, left-hand side consequence B(r) = body, right-hand side condition if B(r) = {} H(r) = fact, always true construction of answer-set in fixpoint iterations to truth assignment of atoms

Answer-Set Example
a b, c bc c. de ed
Iterations: T({}) = {c} T({c}) = {b, c} T({b, c}) = {a, b, c} T({a, b, c}) = {a, b, c}

d & e not contained!

Answer-Set Programming II
atoms: something about reality rules: connection between atoms; assignment gets them to true or false atoms (rules fulfilled) choice rules: 1 { p, q, r } 2 describes, that at least 1 atom of p, q, r but at most 2 are choosen to be true no negation %

Gelfond-Lifschitz-Reduct
Reduce every not in rules result: no negation in rules Interpretation, then check if true or false (accept as true or delete rule) all facts Example: all rules without neg.

a not b a. c not d c. db db d e, not a de e d, not a ed

ANTON
with ASP model is defined due that music is harmonic and melodic valid (instance of rules atoms) ANTON consists of 191 loc (28 melodic and harmonic rules) piece with 8 notes: 3.500 atoms; 13.400 rules duet with 16 notes: 11.000 atoms; 1.350.000 rules

runtime of anton
piece for 1 voice with _length_ notes

piece for 2 voices with _length_ notes

clause learning-mechanism better performance

Twenty Short Pieces (excerpt)


verification by human disadvantage: only quarter notes advantage: due declarative prog. order of rules processing doesnt matter and rule base is extendable

trying to get insight to Anton's thinking

0:57

Twenty Short Pieces (Harmony)

Some Example in Code


key-rule: choosenNote(P, T, N) at time T, voice P plays note N discrete time (quarter notes in this example) may consists of more than one voice (polyphonic) octave is divided in 12 intervals independent from temper

Example II
keyMode(lydian). choosenNote(1,1,25). choosenNote(1,2,24). choosenNote(1,8,19). choosenNote(1,9,20). choosenNote(1,10,24). choosenNote(1,14,29). choosenNote(1,15,27). choosenNote(1,16,25). #const t=16. configuration(solo). part(1).

Some Rules
% every note must be in the scale #const err nik=note not in scale". reason(err nik). error(P,T,err nik) :- choosenNote(P,T,N), chromatic(N,C), not key(C).

% melodic minor -> last two notes depend on direction of playing error(P,T + 1,err ism) :- choosenNote(P,T + 1,N), chromatic(N,9), upAt(P,T), keyMode(minor).
% voices can only meet at one time haveMet(P,T+1) :- choosenNote(P,T,N), choosenNote(P+1,T,N), not haveMet(P,T), part(P+1). haveMet(P,T+1) :- haveMet(P,T). % every note, the next note must be an other (up or down) 1 { stepAt(P,T), leapAt(P,T) } 1 :- T != t. 1 { downAt(P,T), upAt(P,T) } 1 :- T != t.

% if melody does a jump, only harmonic intervals are allowed 1 { leapBy(P,T,LS) : leapSize(LS) : LS > 0 } 1 :- leapUp(P,T). % if a voice changes of interval I the next note must be I steps higher/lower choosenNote(P,T + 1,N + L) :- choosenNote(P,T,N), leapAt(P,T), leapBy(P,T,L), note(N + L).

ANTON
filling of bars no problem harmonisation no problem harmonisation rules (rules may be taken from J.S.Bach Choralgesnge consistent rules) ANTON produces diff. formats (i.e. Csound, Lilypond) and open for further ones

Evaluation
musical technical subjective by human ~200 loc for a script (halftone quartertone ALL libs and so on: ~800 music) loc STRASHEELA (UC Belfast): 8000 loc BOL-Proc.-Script: 88000 loc

Work on ANTON
better runtime performance (Anton 1.5) real time composition improvisation composing trios and quartets (Anton 1.5) rhythmic composition (Anton 1.5) recognizing and using of global structures

ANTON 1.5 (no yet released)


runtime for generating pieces for 1/2 voice(s) with _length_ notes
0.22 1.01 2.27 4.62 0.33 1.06 2.42 4.01

0.77 3.73 16.84 29.63

1.18 3.88 14.50 82.64

old values

ANTON 1.5
runtime for generating pieces for 3/4 voice(s) with _length_ notes

Example from ANTON 1.5


code-remarks style(quartet). part(1..4). melodicPart(1). lowestPart(4). #const quartetBottomNote=1. #const quartetTopNote=68. % from contra C (lowest + 2 octaves 8vb) to g (highest + 2 octaves)

4/4 or 6/4 or ??
0:26

Verification with lydian chromatic concept George Russel


method of scale-finding for improvisation chord some lydian scale = parent scale chord lydian scale from note (b7, b9, -b5, maj = tonic) visualisation-model of Robert M. Wei (worked with George Russel) travelling through quint-circle

Verification with lydian chromatic concept George Russel II

A Child Is Born

Conclusion / Future Work


- Anton is some kind of composition - not the overall solution - would be useful if it works in realtime Future work: trying to get a verification model through my mathematical visualisation of music in architecture

Reductio ad absurdum but good


Christmas-Song Es ist ein Ro entsprungen
(A)

||: Bbmaj Eb7 | | | Gsus

|
(B)

Abmaj F#7b5 A-5b13

| Fm7 Bb7#11 |
(A)

Ebmaj Abmaj || | | 0:49

:|| B-7

| E-7

|| Bbmaj Eb7

Abmaj F#7b5 | Cmaj ||

Fm7 Bb7#11

| Ebmaj Abmaj | Gsus

- odd count of bars - melody some chords (arbitrary) - most incorrect cadences - some correct cadences - global structure: AABA

Quellen [1] Automatic Composition of Melodic and Harmonic Music by Answer Set Programming, Georg Boenn, Martin Brain, Marina De Vos, John ffitch, Cardiff School of Creative & Cultural Industries University of Glamorgan UK [2] ANTON: Composing Logic and Logic Composing, Georg Boenn, Martin Brain, Marina De Vos, John Ffitch, Cardiff School of Creative & Cultural Industries University of Glamorgan UK [3] Ursprungskunst, Erhard Dinhobl, BSc-Thesis, 2008, TU Wien [4] Persnliche Korrespondenz mit Robert M. Weiss / Lehrgang Lydian Chromatic Concept am Josef M. Hauer Konservatorium Wr. Neustadt [5] Persnliche Korrespondenz mit Michael Brain, Entwickler ANTON [6] Das wohltemperierte Gehirn: Wie Musik im Kopf entsteht und wirkt, Robert Jourdain, Spektrum Verlag, 2001 [7] Neue Jazz-Harmonielehre, Frank Sikora, SCHOTT, 2003 [8] The Lydian Chromatic Concept of Tonal Organisation, George Russel, Concept Publishing Co. New York N.Y, 1953 (2001) [9] Automatic Composition using Anwer Set Programming, Georg Boenn, Martin Brain, Marina de Vos, John Ffitch, University of Glamorgan, UK, 2009 [10] 389 Choralgesnge (fr vierstimmigen gemischten Chor), J.S.Bach [11] Knowledge, Representation, Reasoning and Declarative Problem solving, Chitta Baral, University of Cambridge, 2003 [12] Logische Programme und Antwortensemantik II, Prof. Dr. Gabriele Kern-Isberner, Universitt Dortmund, 2004 [13] Persnliche Korrespondenz mit Monika Etzelt Feel free to contact me: Erhard Dinhobl / er@master-studios.net

S-ar putea să vă placă și