lilypond-user
[Top][All Lists]
Advanced

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

Function for /score block


From: foxfanfare
Subject: Function for /score block
Date: Wed, 24 Apr 2019 22:01:28 -0700 (MST)

Hi all,

I have a piano book to write with several individual pieces. I'm currently
setting my environments and I have decided to devide in several files all
the configuration (one for the meters of all pieces, one for the dynamics,
etc.). I am working on a file which will set the layout of the score and
call all my predefine variables. Here is my model:

IA = {

  \new PianoStaff \with {
    instrumentName = \markup \instrumentNameNumber "1"
    midiInstrument = "acoustic grand"
  }
  <<
    \new Staff = "RH"
    << 
      \IA-forme
      \IA-dialogue
      \new Voice = "MDI" \IA-MDI
        \audio { \context Voice = "MDI" { << \IA-dynamique \IA-pedale >> } }
      \new Voice = "MDII" \IA-MDII
        \audio { \context Voice = "MDII" { << \IA-dynamique \IA-pedale >> }
}
      \new Voice = "MDIII" \IA-MDIII
        \audio { \context Voice = "MDIII" { << \IA-dynamique \IA-pedale >> }
}
    >>
    \new Dynamics \IA-dynamique
    \new Staff = "LH"
    << 
      \IA-forme
      \new Voice = "LHI" \IA-MGI
        \audio { \context Voice = "MGI" { << \IA-dynamique \IA-pedale >> } }
      \new Voice = "LHII" \IA-MGII
        \audio { \context Voice = "MGII" { << \IA-dynamique \IA-pedale >> }
}
      \new Voice = "LHIII" \IA-MGIII
        \audio { \context Voice = "MGIII" { << \IA-dynamique \IA-pedale >> }
}
      \IA-pedale
    >>
  >>

}

This model will be sensibly the same between all my pieces. The only thing
that might change is the name of the piece (here it is "IA"). I wonder, is
it possible, instead of copying each time the same instrumentation, to call
this block in a function and replace each time the name of the piece by the
one defined? For instance, something like "\instrumentation #"IA"" or
"\instrumentation #"IB"", etc...



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html



reply via email to

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