Disclosed herein are computer-implemented method, computer-readable storage medium, and DAW embodiments for implementing a music composition aid. An embodiment includes retrieving a first constraint value, receiving a selection of a set of musical elements, and accepting a second constraint value corresponding to the set of musical elements. Some embodiments further include invoking an iterator function, using at least the second constraint value as an argument, and generating an output of the iterator function, limiting a size of the output of the iterator function, according to the lesser of the first constraint value or a transform of the second constraint value. Output of the iterator function may include, of the set of musical elements, a subset determined by the second constraint value. The size of the output may be no more than the first constraint value. Further embodiments may render the output of the iterator function visually and/or audibly, for example.
展开▼