lilypond-user
[Top][All Lists]
Advanced

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

duration using variable


From: Gianmaria Lari
Subject: duration using variable
Date: Wed, 27 Apr 2016 10:56:53 +0200

I don't know if the following code is well written (suggestions are pretty welcome!!) but it works as I like (:)) and let me generate two different output according the tag midiOut or screenOut. 

\version "2.19.40"

mynote = c

mynoteExp = {\mynote} 
mynoteDouble = {<\mynote' \mynote>}

cC = {\tag #'midiOut \mynoteDouble 
      \tag #'screenOut \mynoteExp }

music =
{
  \time 3/4 \clef bass
  \cC
}

\score 
{
  \keepWithTag #'screenOut \music
  \layout {}

\score 
{
  \keepWithTag #'midiOut \music
  \layout {}
  \midi {}

In the attached capture.png you can see the two different output, the first when using screenOut and the second using midiOut.

* * *

Now I would like to be able to increase the lenght of the musical _expression_ contained in the cC variable.

In the previous example the cC variable contains a quarter note (and a quarter bichord) and I would like to change it to an half note. I tried with the "changePitch.ly" snippet (http://gillesth.free.fr/Lilypond/changePitch/changePitchDoc-sources/changePitch-doc.pdf) writing 

\changePitch {a2} \cC

but this does not work. 

Here it is the whole code (I highlighted the differences compared to the previous example)

\version "2.19.40"
\include "changePitch.ly"

mynote = c

mynoteExp = {\mynote} 
mynoteDouble = {<\mynote' \mynote>}

cC = {\tag #'midiOut \mynoteDouble 
      \tag #'screenOut \mynoteExp }

music =
{
  \time 3/4 \clef bass
  \changePitch {a2} \cC
}

\score 
{
  \keepWithTag #'screenOut \music
  \layout {}

\score 
{
  \keepWithTag #'midiOut \music
  \layout {}
  \midi {}

and in the attached file capture2 you can find the output for this second scenario.

Consider that:
- the variable cC will always contain a single note or a single chord
- I tried using changepitch but any other (possibly simpler) way is welcome

Any suggestion?
Thank you, g.

Attachment: Capture.PNG
Description: PNG image

Attachment: Capture2.PNG
Description: PNG image


reply via email to

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