On Tue, 2008-08-05 at 00:03 -0700, Jordan Eldredge wrote: > I am currently working on wikilily.org and realized that one thing > that could be very helpful when collaborating on Lilypond code, would > be a style guide. My question for all of you is: has any other project > drafted a style guide for Lilypond code? Not that I know of. Style is somewhat personal, but I'll contribute the indentation that I always use.
> The main things I imagine it wold cover would be: > > How many spaces should an indent be? I use 2 (spaces, not tabs). > When should indentation be used? After every '{' or '<<', unless the music enclosed in these delimiters is very short. I put these delimeters (and the corresponding closing delimiters) on a line by themselves. > Where should line breaks be used? At least every bar. If a bar is long, there should be a break within the bar, preferably at a rhythmically significant point. I put bar checks every bar, at the beginning of the line. The bar checks are un-indented by 2 spaces. This makes it easy to see which lines are new bars by scanning down the left hand side: { | a4 b c d | a4 b c d | a8 a a a % long bar b8 b b b | a4 b c d % new bar I also put a comment every 5 or 10 bars with the bar number in it. > Where should spaces be used? I put spaces in between notes, but not in between any articulations or markups that follow a note: a8->-.\f^\markup {"blah"}~ a8 not a8 -> -. \f etc. > Another thing it might include would be: > > A general guide for structuring the code. I put each instrument in its own variable and common markings in a separate variable. If I need to tweak line or page breaking, I put breaks in another variable. Similarly if I need to tweak things with extra-offset (something that I have pretty much stopped doing since 2.11). I have never used \tag, probably because I developed my lilypond habits before it was introduced and I never bothered to change. Then I use python scripts to generate \score blocks (because they are very repetitive) for each instrument and for the score. But that's probably beyond the scope of a style guide. Joe _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user