lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: code suggestions


From: Daniel Hulme
Subject: Re: code suggestions
Date: Fri, 10 Oct 2008 09:08:08 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

On Fri, Oct 10, 2008 at 03:03:53AM -0400, David Stocker wrote:
> \paper {
>   #(set-paper-size "concert")
>   }
This is entirely a matter of preference, but I'd suggest making the
closing brace be at the same indentation level as the line that opens
the block, like so:

\paper {
  #(set-paper-size "concert")
}

It makes it much easier to spot when you forget a closing brace. Your
text editor should be able to do this for you automatically, which will
also ensure that your indentation is consistent - sometimes in your file
you use two spaces, sometimes four, and sometimes a tab character. It
would stop you doing things like this:

> rightHand = {
>   \tempo \markup { "Allegretto" }
>     <<
>       \voiceOne {
>       \relative c'' {
>       %1
        ...
>       }
> }
> \\
>        \voiceTwo {
>        \relative c'' {
>        %1
         ...
>        }
>       }
>        >>
>   
>   \oneVoice {
>     \relative c'' {
        ...
>       }
>     }
> <<
    ...
>   >>
> }

The indentation's so confusing in that block I could only find the end
of rightHand's definition by using Vim's 'jump to matching bracket'
command.

> leftHand = {
>   \relative c' {
>     \oneVoice
>     %1
>     R1 |
>     %2
>     R1 |
>     %3
>     R1 |
>     %4
>     R1 |
>     %5
>     R1 |
>     %6
>     R1 |
>     %7
>     r8 c16 b c8 g af c16 b c8 d |

Much as "one bar per line" is a useful rule, you might find it more
concise to abbreviate the first six bars to
      R1*6
      %7
      r8 c16 ... |

Note that R rests (unlike r rests) have an implied bar check on either
end, so you don't need | before or after.

That's all I could spot in a brief skim; I can't spend more time on it
as I'm on the way out to work.

-- 
"Art is never finished, only abandoned."               Leonardo da Vinci
http://surreal.istic.org/                      No one heard that but me.

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]