[prev in list] [next in list] [prev in thread] [next in thread]
List: lilypond-user
Subject: Re: All but last note
From: Pierre Perol-Schneider <pierre.schneider.paris () gmail ! com>
Date: 2016-01-29 11:54:10
Message-ID: CAPHOTuW4B+U91Oh9cGm2XhBmZNNVhoS+y0gh2-6juCEudMa84Q () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Copied! Thank you David.
Pierre
2016-01-29 12:36 GMT+01:00 David Kastrup <dak@gnu.org>:
> Pierre Perol-Schneider <pierre.schneider.paris@gmail.com> writes:
>
> > Hi List,
> >
> > I'd like to add glissandi to a group of notes except the last one.
> > Here's the function:
> >
> > glissandi =
> > #(define-music-function (parser location music) (ly:music?)
> > "Add a glissando to all but last note"
> > (let ((all-but-last-note (drop-right (ly:music-property music
> > 'elements))))
> > (set!
> > (ly:music-property all-but-last-note 'articulations)
> > (cons (make-music 'GlissandoEvent)
> > (ly:music-property all-but-last-note 'articulations)))
> > music))
> >
> > \relative c' {
> > \glissandi { c d e f }
> > c
> > }
> >
> > It seems that 'drop-right' is not the right procedure. What else should I
> > use?
>
> drop-right is fine but you forgot the second argument.
>
> -- Scheme Procedure: drop-right lst i
> -- Scheme Procedure: drop-right! lst i
> Return the a list containing all but the I last elements of LST.
>
> `drop-right' always returns a new list, even when I is zero.
> `drop-right!' may modify the structure of the argument list LST in
> order to produce the result.
>
> --
> David Kastrup
>
[Attachment #5 (text/html)]
<div dir="ltr"><div>Copied! Thank you David.<br></div>Pierre<br></div><div \
class="gmail_extra"><br><div class="gmail_quote">2016-01-29 12:36 GMT+01:00 David \
Kastrup <span dir="ltr"><<a href="mailto:dak@gnu.org" \
target="_blank">dak@gnu.org</a>></span>:<br><blockquote class="gmail_quote" \
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span \
class="">Pierre Perol-Schneider <<a \
href="mailto:pierre.schneider.paris@gmail.com">pierre.schneider.paris@gmail.com</a>> \
writes:<br> <br>
> Hi List,<br>
><br>
> I'd like to add glissandi to a group of notes except the last one.<br>
> Here's the function:<br>
><br>
> glissandi =<br>
> #(define-music-function (parser location music) (ly:music?)<br>
> "Add a glissando to all but last note"<br>
> (let ((all-but-last-note (drop-right (ly:music-property music<br>
> 'elements))))<br>
> (set!<br>
> (ly:music-property all-but-last-note 'articulations)<br>
> (cons (make-music 'GlissandoEvent)<br>
> (ly:music-property all-but-last-note \
'articulations)))<br> > music))<br>
><br>
> \relative c' {<br>
> \glissandi { c d e f }<br>
> c<br>
> }<br>
><br>
> It seems that 'drop-right' is not the right procedure. What else should \
I<br> > use?<br>
<br>
</span>drop-right is fine but you forgot the second argument.<br>
<br>
-- Scheme Procedure: drop-right lst i<br>
-- Scheme Procedure: drop-right! lst i<br>
Return the a list containing all but the I last elements of LST.<br>
<br>
`drop-right' always returns a new list, even when I is zero.<br>
`drop-right!' may modify the structure of the argument list LST in<br>
order to produce the result.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
David Kastrup<br>
</font></span></blockquote></div><br></div>
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic