lilypond-user
[Top][All Lists]
Advanced

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

Re: MIDI export: \partial measure and volta repeats


From: Federico Bruni
Subject: Re: MIDI export: \partial measure and volta repeats
Date: Thu, 18 Jun 2009 06:44:56 +0200
User-agent: Thunderbird 2.0.0.21 (X11/20090318)

Mats Bengtsson wrote:

An alternative that perhaps is even simpler, is to use the \tag and \keepWithTag features, see http://lilypond.org/doc/v2.12/Documentation/user/lilypond/Different-editions-from-one-source#Using-tags
for a general description and
http://lists.gnu.org/archive/html/lilypond-user/2009-02/msg00314.html
for an example where it's used to make different versions in midi and printed output.


I like very much this alternative.
Unfortunately, I can't make it working: it says that \tag... is unexpected string.

Also, I probably made a mess in the score section.
I attach the file: any advice is appreciated
\version "2.13.0"
\include "english.ly"
\include "tablature.ly"

\header {
        title = "Bourrée"
        composer = "Johann Sebastian Bach"
}

\paper {
                left-margin = 15\mm
                line-width = 180\mm
                indent = 0\mm
                top-margin = 10\mm}
        % for testing purposes only; in newer versions of lilypond, they will be
        % already defined:
        #(define-public guitar-seven-string-tuning '(4 -1 -5 -10 -15 -20 -25))
        #(define-public guitar-drop-d-tuning       '(4 -1 -5 -10 -15 -22))
        #(define-public bass-four-string-tuning    '(-17 -22 -27 -32))
        #(define-public bass-drop-d-tuning         '(-17 -22 -27 -34))
        #(define-public bass-five-string-tuning    '(-17 -22 -27 -32 -37))
        #(define-public bass-six-string-tuning     '(-12 -17 -22 -27 -32 -37))


        
upper = \relative c'   {
        \set Staff.midiInstrument = #"acoustic guitar (nylon)"
        \set fingeringOrientations = #'(left)
        \time 4/4
        \key g \major
        \tag #'partial  { \partial 4  e'8  fis' }
        \tag #'rests  { s2. e'8 fis' }
        \repeat volta 2  {
        \mark  \markup { \bold A } %1st section
        g4-4  fs8-2  e  ef4-4  e8  fs-2  |  b,4  cs8-2  ds-4  e4  d8-4  c-1  |  
b4  a8-1  g  fs4-4  g8  a-2  |  b  a  g  fs-4  e4-2  e'8  fs-4   \break |  
        g4-4  fs8-2  e ef4-4  e8  fs-2  |  b,4  cs8-2  ds-4  e4  d8-4  c-1  |  
b4  a8-1  g  fs4-2  d }
                  \alternative { 
                          { < g,-2  b-1  d  g >2  \deadNote < g  b  d  g >4   
e''8  fs-4   \break }
                          { < g,,-2  b-1  d  g >2  \deadNote < g  b  d  g >4  
b'8  g }  
                  }

        \repeat volta 2  {
        \mark  \markup { \bold B }  % 2nd section
        d'4-4  a8-3  c-1  b4  g'8-4   d-3  |  e4  b8  d-1  c4\3-4  b8  a-3  |  
gs4-1  a8-3  b   c4-1  b8  a  \break |
        a2.-3  d8-4  a-3  |  b4  g'8-4  d-3  e4  b8  d-1  |  c\3-4  
ef16\glissando-3 e\2  a8-4  e8\2\glissando  fs4\2-3  cs8-3 e |  d4-3  df8-2  b  
bf16-2(  b\3-3 ) bf4 b8  \break |
        b2.  a'8-4  fs-1  |  g4-3  fs8-1  e  a4-4  e8  g-3  |  fs4-1  e8  d-3  
g4-4  d8  f-1  |  e4  a8-4  e  fs4-3  cs8-2  e  |  ds4-4  b2  e8  b  \break|
        c-2  e,-2  d'-2  a-1  b  ds,-1  c'-1  g  |  a-1  fs-4  a  fs  g  e-1  
fs-3  e  |  ef4-1  e8-3  fs-4  g\4-4  fs16(  g\4 )  fs8  e } 
                \alternative { 
                        {  e2.  b'8  g  }
                        {  e1  }
                }
}

lower=  \relative c'    {
        \tag #'partial  { \partial 4  g,8  fis }
        \tag #'rests { s2. g8 fis } 
        \repeat volta 2  {  %1st section
        e4  a  b-1  a  |  g-3  fs-1  e  fs-2  |  g-2  a  b-1  a  |  g-3  b-1  
e,8  fs-1  g-3  fs-3  |
        e4  a  b-1  a  |  g-3  fs-1  e  fs-2  |  g-3  c-2  d2\5-3 }
                \alternative {
                        { s2.  g,8-3  fs-3 }
                        { s2.  g4-2  }
                }
        \repeat volta 2  {  % 2nd section
        fs-2  d'  g,-2  b-1  |  c-1  gs-2  a  d  |  e-2 a, e' e, |
        a8  b-2  a  g-4  fs4-2  fs  |  g-2  b-1  c-1  af-2  |  a  df-1  d  bf-1 
 |  b-1  e-1  fs,2-1  |
        b8-1  bf-1  b-2  cs-4  ds4-1  b-1  |  e-1  d  df-1  a  |  d  c-2  b-1  
g-2  |  c-2  b-1  a  fs-1  |
        b4.-1  c8-2  b-1  a  af4-3  |   a4  fs'-3  g,-3  e'-2  |  gs,-1  ds'8-1 
 r  e,4  a  |  b2-2  b4.  r8  }
                \alternative { 
                        {  e,2.  g4-2  }
                        {  e1  }
                }
}

\score { \keepWithTag  #'partial  {
 <<
     \new Staff = "guitar" <<
         \context Voice = "upper guitar" { \clef "G_8" \voiceOne \upper }
          \context Voice = "lower guitar" { \clef "G_8" \voiceTwo \lower } >>
     \new TabStaff = "tab" <<
       \context TabVoice = "upper tab" { \clef "moderntab" \voiceOne \upper }
       \context TabVoice = "lower tab" { \clef "moderntab" \voiceTwo \lower } >>
 >>
        
        \layout  {
        }
} 


\score {
        \keepWithTag  #'rests  {
        \unfoldRepeats  <<
        \new Staff = "guitar" <<
         \context Voice = "upper guitar" { \clef "G_8" \voiceOne \upper }
          \context Voice = "lower guitar" { \clef "G_8" \voiceTwo \lower } >>
        }
>>
        \midi {
                \context  {
                        \Score
                        tempoWholesPerMinute = #(ly:make-moment 90 4)
                }
        }
} 


reply via email to

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