[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">&lt;<a href="mailto:dak@gnu.org" \
target="_blank">dak@gnu.org</a>&gt;</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 &lt;<a \
href="mailto:pierre.schneider.paris@gmail.com">pierre.schneider.paris@gmail.com</a>&gt; \
writes:<br> <br>
&gt; Hi List,<br>
&gt;<br>
&gt; I&#39;d like to add glissandi to a group of notes except the last one.<br>
&gt; Here&#39;s the function:<br>
&gt;<br>
&gt; glissandi =<br>
&gt; #(define-music-function (parser location music) (ly:music?)<br>
&gt;     &quot;Add a glissando to all but last note&quot;<br>
&gt;     (let ((all-but-last-note (drop-right (ly:music-property music<br>
&gt; &#39;elements))))<br>
&gt;        (set!<br>
&gt;         (ly:music-property all-but-last-note &#39;articulations)<br>
&gt;              (cons (make-music &#39;GlissandoEvent)<br>
&gt;                       (ly:music-property all-but-last-note \
&#39;articulations)))<br> &gt;     music))<br>
&gt;<br>
&gt; \relative c&#39; {<br>
&gt;     \glissandi { c d e f }<br>
&gt;     c<br>
&gt; }<br>
&gt;<br>
&gt; It seems that &#39;drop-right&#39; is not the right procedure. What else should \
I<br> &gt; 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&#39; always returns a new list, even when I is zero.<br>
        `drop-right!&#39; 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