Hi,
If you ever wondered, how to persuade a Constraint solver to do some bluegrass improvisations (no you haven't), wait no longer. Here is the answer:
Ok, it is not really "improvisation" but the generation of a melody under hand crafted constraints. But the constraints are similar to what you would read in books about bluegrass improvisation (Use the pentatonic scale..) minus the musicality ;-).
Nevertheless i hope this is a good start for your own experiments with music and constraint programming.
The tough part was getting all the music libraries to work in the notebook, but thats software development (80% of the time you are spent with tasks not really relevant to what you want to achieve).
The implementation using Google's CP-SAT Solver (Google's CP SAT Solver) can be found in this github gist Fun With CP Bluegrass Improvisation.
If you are using Google's Colaboratoy (http://colab.research.google.com/) you should be able to open and run the notebook with "open in colab".
This is the result of one of the constraint solvers "solos":
And here are some examples, how real solos should sound ;-):
Blogging is dead, long live blogging. Ok, maybe i binge-watched too much Big Bang Theory but inspired by Sheldon Coopers "Fun with Flags" i started the "Fun with Constraint Programming" blog. This will hopefully contain fun (nerdy) things to do with Constraint Programming. If you are looking for a more general blog about constraint programming i recommend the excellent blog Constraint Programming Blog by Hakank K.
Subscribe to:
Post Comments (Atom)
Solving CSP problems in the browser with Sentient
It is surprising difficult to find a CSP Solver for solving CSP Problems directly in Javascript. One such systems is Sentient https://sent...
-
It is surprising difficult to find a CSP Solver for solving CSP Problems directly in Javascript. One such systems is Sentient https://sent...
No comments:
Post a Comment