lilypond-user
[Top][All Lists]
Advanced

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

generating midi and simplify code


From: Gianmaria Lari
Subject: generating midi and simplify code
Date: Thu, 15 Jun 2017 13:15:19 +0200

I already asked some question about \markup and \midi and get some usefull answer. Here I attached the real code I'm working on.

I would like to generate the midi and I would appreciate some suggestion.

Kieren suggest to separate the layout and midi. Pro: clear and easy to do; Cons: a bit verbose and difficult to maintain.

Thomas Morley proposed a scheme method to extract the score from the markup. Pro: it works nicely with some test examples. Cons: complex.

I personally would prefer Kieren solution because I can handle it better.  But maybe organizing the code differently gives better solution....?

* * *

My code looks to me very redundant. For example:

\markup \justify-line {
  \score {{ \set Staff.instrumentName = #(nextcount) 
            \clef bass \override Score.TimeSignature #'stencil = ##f 
            \cadenzaOn 
            \tetrachordOneUp
            \cadenzaOff}
  }
  \score {{ \set Staff.instrumentName = #(nextcount) 
            \clef bass \override Score.TimeSignature #'stencil = ##f
            \cadenzaOn 
            \tetrachordOneDn
            \cadenzaOff}
  }
  \score {{ \set Staff.instrumentName = #(nextcount) 
            \clef bass \override Score.TimeSignature #'stencil = ##f 
            \cadenzaOn 
            \tetrachordOneUpDn
            \cadenzaOff}
  }
}

This repeats three times the same thing except for referencing different variables: 

\tetrachordOneUp 
\tetrachordOneDn 
\tetrachordOneUpDn

Is this the correct way to go or is there any way to simplify it?
Thank you, g.

Attachment: test.ly
Description: Text Data

Attachment: Capture.PNG
Description: PNG image


reply via email to

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