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: Wed, 2 Jan 2013 22:12:34 +0100


On Sat, Nov 24, 2012 at 1:26 PM, Olivier Biot <address@hidden> wrote:
Hi all,

Sometimes arpeggios are written as chords to avoid repetitive and lengthy arpeggio expansions in a written score.

However, is there a way in LilyPond to transform chords into bowed arpeggio expansions, as illustrated in the example below (first bar = input, 2nd bar = automatically generated expansion based on input)?

Dear all,

Following up on my own request, I stumbled upon an insightful article featuring Bach's prelude for piano (BWV 846):
http://news.lilynet.net/?The-LilyPond-Report-23#feature_story_prelude_1_in_scheme

Based on this example I managed to create a first version, which however only works with *absolute* pitches (see measure 1).

How can I make it work with *relative* pitches (see measure 2)?

%%% BEGIN Snippet
\version "2.16.1"

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."
                #{
                  $p1 $d ( $p2 $d $p3 $d $p4 $d )
                  $p4 $d ( $p3 $d $p2 $d $p1 $d )
                #})

theMusic = {
  \arpeggiate 8 g d' a' e''
  \relative g {
    \arpeggiate 8 g d' a' e'
  }
}

\score {
  \new StaffGroup <<
    \new Staff {
      \relative g {
        <g d' a' e'>1 q
      }
    }
    \new Staff {
      \theMusic
    }
  >>
  \layout { }
  \midi { }
}
%%% END Snippet

Best regards,

Olivier

reply via email to

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