Hi FoC! I'm looking into making a notation softwa...
# thinking-together
i
Hi FoC! I'm looking into making a notation software (music composition) that is centered around constraints, due to writing music that is hard to express in current systems. I know Dorico has explored this area, but it seems that most such systems hit a ceiling where they can't be realtime anymore. At some point they start to hiccup like complex puzzle games or that hang while finding a new solution to a change in the system. I've been inspired lately by cellular automata, and its ability to approach solutions incrementally, so I'd like to implement my tool in that spirit — where changes are propagated over time, approaching a solution in real time, by allowing invalid states during transition (or I guess in general). The goal would be letting the user watch it unfold and continually change it even if it isn't fully settled yet. Problem is, I don't know what keywords to search for or implementation strategies to use. The closest/modt useful inspiration I've found have been soft body physics simulations, UV map relaxation and soft interpolation of colors as well as rotations, because most talks on constraint programming focus on discrete values and proof-like-examples (sudoku and friends) which I guess is ... valuable, but not very concious / interested of how it moves through real time Does that make sense? Do you have any tips / keywords for me? Hugs! /Ivan
❤️ 2
i
We did a bunch of projects that used constraints a few years back. One of them is called Inkling (here's the silly website I made for it). It used a relaxation-based solver called uncmin, which AFAIK is a port of a java port of some old fortran thing. But, it works really damn well. For Inkling, Alex Warth wrote a little constraint system around the solver. Our use case was focused on constraining geometric objects in space, so we cared about things like the difference between solving in polar coords (good) vs cartesian (bad). But ultimately it's all just "here are a bunch of variables, and here are some limits on how they're allowed to change" and then you crank the solver over and over and it wiggles the variables until they converge on good values (ideally), or it blows up :) Guillermo Webster made a little graphics library called g9 that includes a reworked version of uncmin, but it didn't work as well for us. Another keyword you might want to explore is "gradient descent". Good luck! Feel free to ask me any questions and I'll help if I can.
❤️ 2
w
Just to be clear... when you say "a notation software (music composition) that is centered around constraints" are you talking about "engraving" as in the typesetting of standard musical notation or are you picturing of some different music notation or do you mean constraint based music generation itself where visualization helps with whatever you're doing.
❤️ 1
a
In general, constraint solving may require entirely backtracking from a failed attempt at solving the constraints and trying something else. You can represent this dynamically over actual time, but it's going to look more like thrashing around than "gradually approaching" a solution. If you want to avoid that, you want to look for constraint systems that can be solved monotonically (I don't know if that's the technical term, but it might be), especially by gradient descent would be nice. Otherwise you're pretty much into the space of representing arbitrary constraint satisfaction algorithms musically, which is cool but maybe not what you had in mind. Basically I think it's going to depend on what kind of constraints you allow. I honestly don't see the link with cellular automata. Drawing a link between a particular cellular automaton and any constraints that its results do or don't follow is famously difficult.
❤️ 2
1
...hmm, Google results for "differentiable constraints" or "continuous constraint solver" are all irritatingly machine-learning-flavored, but otherwise that would kind of be the right idea for something that can be accurately solved gradually. Ivan's mentions of relaxation and gradient descent might be your best lead.
😢 1
i
@wtaysom Oh, gotcha. Yeah, music generation. The main focus is exploring a scale/meter/tempo-agnostic approach to representation while still interacting graphically / structurally. For scores I'd implement an export and use LilyPond.
🤍 2
@Andrew F Yeah I think you might be right. I have a hunch that what it's not so much about the constraints but rather how incremental computation in general can make an interface feel more responsive. (I think I got carried away because if changes propagate visibly it's easy to begin dreaming of allowing those propagations to dance around the score eternally, with grand battles of multiple conflicting changes trying to shape the score until some by chance take over or the user intervenes. I guess I'm not inspired by cellular automata specifically, but rather how it can be designed for non deterministic partial execution and still eventually settle (as demonstrated by Dave Ackley's robust first tiles and @Lu Wilsons sandpond implementations). It seems like such a fun way to delegate work, but I probably got carried away in my thinking.)
👍 1
❤️ 2
a
That does sound pretty awesome tbh. I hope you get something figured out. 😄
💞 1
i
@Ivan Reese Thank you so much! Inklings was exactly the type of example I had somewhere in the back of my head. Installing and noodling around with it really helped me develop a feeling for its affordances. (Ah, embodied knowledge. Such a treat!) Also helpful to get a refresher on the linear regressions and gradient descent, the math really is pretty straight forward. Now I gotta sleep and decompress it all. Thanks again, lots of interesting ideas in that project!
🤍 2
w
I hope you'll share what you learn @Ivan Morén. We have a dedicated #CEZ6QTHL1 channel though it may have been some time since someone posted there. For musical constraint satisfaction, one funny little demo idea I keep in the back of my mind is an interface where one starts with a melodic line, can easily apply "fugal" transformations to the line to produce a fugue. And then as a surprise the performer allows the Melody to float while adding further transformations together with harmonic constrains to tune the melody. It's like the old Prolog example of "running a program backwards" by supplying the part of the conceptual output and solving for input that will produce that output.
💞 1