Generating scores within a function

A music-function uses variables at the point where it's invoked; as a result, if variables are then redefined, the same function will then use the same variables with their new value.
This makes it possible to generate scores in a semi-automated way, as demonstrated here.