lilypond-user
[Top][All Lists]
Advanced

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

Re: Expanding bowed arpeggios


From: Olivier Biot
Subject: Re: Expanding bowed arpeggios
Date: Sun, 27 Jan 2013 13:34:55 +0100

On Thu, Jan 17, 2013 at 2:56 PM, David Kastrup <address@hidden> wrote:

Try something like (planning to commit this macro soonish)
#(defmacro-public make-relative (pitches last-pitch music) [code snipped]

arpeggiate =
#(define-music-function (parser location d p1 p2 p3 p4)
   (ly:duration? ly:pitch? ly:pitch? ly:pitch? ly:pitch?)
   "Arpeggiate each of the 4 notes note with a duration of d."
   (make-relative (p1 p2 p3 p4) p1
                #{
                  $p1 $d ( $p2 $d $p3 $d $p4 $d )
                  $p4 $d ( $p3 $d $p2 $d $p1 $d )
                #}))

This is based on the assumption that you want the next relative pitch be
based on the _first_ note of the arpeggio.  If you want it based on the
last instead, write
   (make-relative (p1 p2 p3 p4) p4
in the respective line.

Thanks David - works like a charm!!!
 
> So far I didn't find a way to make my arpeggio expansion work with
> notes in *relative pitch*. My bet is that I need to do some magic on
> "ly:pitch?" to get it to work, but I am clueless since I don't know
> what I should type as search keywords to get that information. Is
> there for example a relative-pitch-to-absolute-pitch checker routine
> that I could use?

Sorry for taking so long.  Designing a "user interface" and actually
coding this was not exactly trivial.  Note that arpeggiate will work
fine _both_ when using \relative and when not using it.
 
Many thanks for your help David!

Having used it I realize that it works perfectly for my purpose, but maybe others may want to add e.g. fingerings, cautionary accidentals, articulations and dynamics to the arpeggiated output. That of course won't work with the current code for "arpeggiate" since I only look at the notes.

Imagine the following naive (not functional) snippet:

\arpeggiate 16 c-< g'-1 b'!-3 f'-4-\!

Ideally it would render the fingering either to the far left of the arpeggio, or e.g. above each single note of the arpeggiated chord in the first half (avoiding fingering repetitions).

How could that be addressed?

Best regards,

Olivier

reply via email to

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