openlilylib / snippets

A place to store useful pieces of LilyPond code - custom functions, engravers, hacks, templates, examples etc.
Other
120 stars 38 forks source link

Gridly/transpose key #105

Closed Cecca closed 9 years ago

Cecca commented 9 years ago

This PR implements the feature requested in #102. @uliska please tell me if you are fine with this implementation, then I'll go ahead and merge it in gridly/development

uliska commented 9 years ago

At first I thought it was perfect, but then I realized that when you have cells with identical transposeKey the key signature will be printed for each one (try changing the middle one to a, also and you'll see.

I tried to come up with a solution but failed (sorry). I think transpose-music should be wrapped into a call to another function, e.g. transpose-music-range or the like. This would recursively call transpose-music but when the car and the cadr of transpose-keys is the same it would first concatenate the car and the cadr of the music before recursion.

Cecca commented 9 years ago

This is just because the example is rather artificial. If one has the same key signature in subsequent cells with the same transpose-key, then the key signature is something that should go in the opening rather than in the music. This way when the cell is compiled standalone the correct key signature will be set, otherwise it is not added to the output.

It's just like tempo changes: if one wants to have the tempo change appear explicitly in the score he has to place it into the music, otherwise if he wants to make it appear only when the cell is compiled standalone than he should put it in the opening.

uliska commented 9 years ago

OK, I see now. I was mislead to think that the duplicate key signatures were created by the \transpose. So I'm merging this now.

I have by now merged the general-interface branch into master, so this may have significant impact on the gridly/development branch. You should now merge master into gridly/development, and even if there should be no merge conflicts you should take a look if you have to update anything in the syntax.

Then I'd be happy if gridly could be merged into master again ASAP.