lilypond-user
[Top][All Lists]
Advanced

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

Re: rearrange music flow


From: Carl D. Sorensen
Subject: Re: rearrange music flow
Date: Sun, 28 Dec 2008 13:45:17 -0700



On 12/27/08 2:52 PM, "Johan Vromans" <address@hidden> wrote:

> "Carl D. Sorensen" <address@hidden> writes:
> 
>> intro = <<
>>   \context Staff = "StaffOne" {
>>     \context Voice = "VoiceOne" {
>>       c''4 c''
>>     }
>>   }
>>   \context Staff = "StaffTwo" {
>>     \context Voice = "VoiceTwo" {
>>       c'4 c'
>>     }
>>   }
>>>> 
>> 
>> verseOne = <<
>>   \context Staff = "StaffOne" {
>> [...]
> 
> Yes, this is what I referred to as "a cumbersome task" :(


OK, so automate it with a music function:

parallelStaffs = #(define-music-function (parser location firstStaff
secondStaff)
                      (ly:music? ly:music?)
#{ <<
     \context Staff = "StaffOne"  {
       \context Voice = "VoiceOne" {
         $firstStaff
       }
     }
     \context Staff = "StaffTwo" {
       \context Voice = "VoiceTwo" {
         $secondStaff
       }
     }
  >> 
#})

intro = \parallelStaffs
  {c''4 c''} 
  {c'4 c'}

verseOne = \parallelStaffs
  {d''4 d''}
  {d'4 d'}

chorus = \parallelStaffs
  {e''4 d'' }
  {e'4 e'}

verseTwo = \parallelStaffs
  {f''4 f''}
  {f'4 f'}

\score {
  {
    \intro
    \verseOne
    \chorus
    \verseTwo
  } 
} 
 


Carl





reply via email to

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