lilypond-user
[Top][All Lists]
Advanced

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

Re: Extract the first notes from a musical expression


From: Gianmaria Lari
Subject: Re: Extract the first notes from a musical expression
Date: Thu, 15 Nov 2018 08:08:34 +0100

I read my msg. and I found it not very clear. I hope this is a bit more clear:
Suppose I have a variable containing the following music _expression_:


{

a4 b4 c'4 d'4 |

b4 b4 a4 a4 |

c'4 b4 a4 b4 |

a4 a4 c'4 a4 |

c'4 b4 a4 c'4

}


How can I get only the first n quarters of the variable? Something like:


\extractMusic \myVar 4

that should generate

{

a4 b4 c'4 d'4 |

}

?

On Thu, 15 Nov 2018 at 00:16, Gianmaria Lari <address@hidden> wrote:
Consider a simple code similar to the following one: 

\version "2.19.82"
myVar = \fixed c' { a4 b c' a | a4 4 b c | b4 a b c' | ........ 
{\myVar}

This will generate a score containing *all* the notes specified in myVar.

Now, suppose that I don't want to generate all the notes in myVar but only the first 8 quarter notes (the first 2 bars) . Is there any function that can do it? something like "\extractMusic \myVar 4*4".

Thank you, g.


reply via email to

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