300 likes | 402 Views
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.
E N D
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
Introduction Computer Assisted Composition
Introduction Computer Assisted Composition • Common Music / Stella • Rick Taube, ZKM, Germany • EMI • David Cope, USA • OpenMusic • Gérard Assayag, Carlos Agon, IRCAM, France
Introduction OpenMusic, visual
Introduction OpenMusic, object oriented
Overview • Computer assisted composition and OpenMusic • Modelling of musical CSPs • Adaptive search • OMClouds • Guitar
Modelling 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 Harmony, Georges Bloch Une empreinte sonore de la Fondation Beyeler (for ensemble)
Modelling 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 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 Special features of these CSPs • 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
Overview • Computer assisted composition and OpenMusic • Modelling of musical CSPs • Adaptive search • OMClouds • Guitar
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
Adaptive search Local search constraint X = Y error function which measures how much the constraint is satisfied | X- Y | The goal is now to find a configuration with error zero.
Adaptive search projection on each variable Adaptive search constraint X = Y error function which measures how much the constraint is satisfied | X- Y |
Adaptive search Intuitively • Directed search: the structure of the problem is used • at the variable level • at the constraint level • Convergence on variables with bad values • Any kind of constraint can be used, provided the appropriate error functions are defined
Overview • Computer assisted composition and OpenMusic • Modelling of musical CSPs • Adaptive search and musical application • OMClouds • Guitar
OMClouds 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 OMClouds objects associated methods • edit on a score • play • ... musical object asvarlist • values • domains • current errors • tabu status • constraints • ... associated methods • update • initialize randomly • descent • resolution • ...
OMClouds instance of asvarlist method for asvarlist
OMClouds Variables Constraint primitive
OMClouds Edition of partial results
Overview • Computer assisted composition and OpenMusic • Modelling of musical CSPs • Adaptive search and musical application • OMClouds • Guitar
Guitar Guitar C major chord : bass + third + fifth Find a playable realization and the associated fingering 5
Guitar 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 Constraints for two successive chords Several possibilities: • 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
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 error • adaptive search • Visual integration to OM objects by adding the fingergings
Guitar Chords from Mikhaïl Malt
Conclusion • 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