Constraint Satisfaction Problems (CSPs) in computer music are used to solve harmonic, rhythmic or melodic problems. In addition,they can be used for automatic generation of musical structures satisfying a set of rules. Forinstance, the CSP proposed by compositor Michael Jarrell, which we explain in this document anddetail its implementation. Usually, a CSP is represented by a script defining the variables, theirdomain, and its constraints.Instead of writing a script, in Gelisp for OpenMusic (OM) we represent a program with a specialpatch. A patch is a visual algorithm, in which boxes represent functional calls, and connectionsare functional compositions. Inside this CSP patch, we can place special boxes: to connect eachconstraint in the CSP, to define variable and value heuristics, to define a time limit in the search,to connect the list of variables that we want to observe, and a box to connect the variable to bethe optimization criterion during the search.Furthermore, we provide a variety of boxes to represent simple constraints (e.g., a = b anda < 2) and high-level constraints (e.g., “the motive A occurs n times in the sequence S”). Theoutput of a CSP patch can be connected to three different kind of boxes: to find one solution, tofind all the solutions, and to perform propagation (narrow the domain of the variables) withoutsearch.