musical applications of constraint programming using a local search algorithm
DESCRIPTION
Musical Applications of Constraint Programming using a Local Search Algorithm. Charlotte Truchet Laboratoire d’Informatique de Nantes Atlantique Nantes University France. Overview. Computer assisted composition and OpenMusic Modelling of musical CSPs Adaptive search OMClouds Guitar. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/1.jpg)
Musical Applications of Constraint Programming
using a Local Search Algorithm
Charlotte TruchetLaboratoire d’Informatique de Nantes
AtlantiqueNantes University
France
![Page 2: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/2.jpg)
Overview
• Computer assisted composition and OpenMusic
• Modelling of musical CSPs• Adaptive search• OMClouds• Guitar
![Page 3: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/3.jpg)
Computer Assisted Composition
Introduction
![Page 4: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/4.jpg)
Computer Assisted Composition
• Common Music / StellaRick Taube, ZKM, Germany
• EMIDavid Cope, USA
• OpenMusicGérard Assayag, Carlos Agon, IRCAM, France
Introduction
![Page 5: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/5.jpg)
OpenMusic, visual
Introduction
![Page 6: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/6.jpg)
OpenMusic, object oriented
Introduction
![Page 7: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/7.jpg)
Overview
• Computer assisted composition and OpenMusic
• Modelling of musical CSPs• Adaptive search• OMClouds• Guitar
![Page 8: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/8.jpg)
Previous works
• Automatic harmonization: Ebcioglu 87, Tsang Aitken 91, Ballesta 98, Pachet Roy 01
• BOXES (Beurivé, Desainte-Catherine 01), Mosaïcing (Zils, Pachet 01), Pico (Rueda, Valencia 01), MusicSpace (Delerue 04)
• In OpenMusic: Situation (Rueda, Bonnet 90),PWConstraints (Laurson 96)
Modelling
![Page 9: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/9.jpg)
Harmony, Georges Bloch
Modelling
Une empreinte sonore de la Fondation Beyeler (for ensemble)
![Page 10: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/10.jpg)
Asynchronous rhythms, Mauro Lanza
• Variables: rhythmical patterns of fixed, relatively prime lengths L1 ... Ln
• Each pattern is played repetitively on one voice
• Constraint: not two onsets played simultaneously for a fixed duration D
No solution as soon as D >= lcm(Li , Lj) for any i, j
Modelling
![Page 11: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/11.jpg)
Asynchronous rhythms, Mauro Lanza
Erba nera che cresci segno nero tu vivi (for voice and eletronics)Burgertime (for tuba end electronics)Aschenblume (for ensemble)
Modelling
![Page 12: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/12.jpg)
Special features of these CSPs
Modelling
• Expressivity of the constraint language• Need for diverse solutions • Many overconstrained problems• Solutions are re-written afterwards• The resolution process has to be
understood by non-scientific users
![Page 13: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/13.jpg)
Overview
• Computer assisted composition and OpenMusic
• Modelling of musical CSPs• Adaptive search• OMClouds• Guitar
![Page 14: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/14.jpg)
Adaptive search
Adaptive search
• Local search method close to GSAT, WalkSAT, WSAT(OIP) Selman 92, Selman Kautz 94, Walser 99
• Min Conflict Minton 92
• Tabu-like heuristic Glover 89
• Shown to be very efficient on classical academic CSPs Codognet Diaz 03
![Page 15: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/15.jpg)
Local search
Adaptive search
constraintX = Y
error function which measures how much the constraint is satisfied
| X- Y |
The goal is now to find a configuration with error zero.
![Page 16: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/16.jpg)
Adaptive search
Adaptive search
constraintX = Y
error function which measures how much the constraint is satisfied
| X- Y |
projection on each variable
![Page 17: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/17.jpg)
Intuitively
Adaptive search
• Directed search: the structure of the problem is usedat the variable levelat the constraint level
• Convergence on variables with bad values
• Any kind of constraint can be used, provided the appropriate error functions are defined
![Page 18: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/18.jpg)
Overview
• Computer assisted composition and OpenMusic
• Modelling of musical CSPs• Adaptive search and musical application• OMClouds• Guitar
![Page 19: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/19.jpg)
OMClouds
• Homogeneous variables• Three CSPs structures: lists,
permutations, cycles• Take advantage of existing musical
knowledge in OpenMusic• Visual definition of the constraints• By default, automatic transformation of
constraints into cost-functions• Edition of approximate solutions
OMClouds
![Page 20: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/20.jpg)
OMClouds objects
OMClouds
asvarlistvaluesdomainscurrent errorstabu statusconstraints...
associated methods• update• initialize randomly• descent• resolution• ...
musical object associated methods• edit on a score• play• ...
![Page 21: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/21.jpg)
OMClouds
instance of asvarlist
method for asvarlist
![Page 22: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/22.jpg)
OMClouds
Variables
Constraint primitive
![Page 23: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/23.jpg)
OMClouds
Edition ofpartial results
![Page 24: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/24.jpg)
Overview
• Computer assisted composition and OpenMusic
• Modelling of musical CSPs• Adaptive search and musical application• OMClouds• Guitar
![Page 25: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/25.jpg)
Guitar
C major chord : bass + third + fifth
Find a playable realization and the associated fingering
Guitar
5
![Page 26: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/26.jpg)
Constraints for a single chord
• The guitarist uses only four fingers• or three in case of a barré, and then no note
can be played below the barré• The hand has a limited size, depending on the
position• If the mute is possible, then a minimum of
notes must be played• ad lib
Guitar
![Page 27: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/27.jpg)
Constraints for two successive chords
• Minimize the number of cases in the position’s change
• Minimize the number of position changes• Maximize the number of fingers which stay on
the same note • In case of barrés, stay on the same barré
Optimize an ad hoc distance in order to combine all of these possibilities
Several possibilities:
Guitar
![Page 28: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/28.jpg)
Guitar
Resolution
• Solved in two steps• first step : find all the solution for one chord
complete method• second step : find a tour in the solutions with
minimal erroradaptive search
• Visual integration to OM objects by adding the fingergings
![Page 29: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/29.jpg)
Guitar
Chords from Mikhaïl Malt
![Page 30: Musical Applications of Constraint Programming using a Local Search Algorithm](https://reader038.vdocuments.net/reader038/viewer/2022110403/56812b3a550346895d8f4c1a/html5/thumbnails/30.jpg)
• Musical application give new, original CSPs and shows a good example of non-academic use of CP
• CP is a flexible programming tool for the composers• OMClouds takes advantage of the whole search
process, and naturally copes with overconstrained CSPs
Conclusion