lilypond-user
[Top][All Lists]
Advanced

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

RE: Automatic octaves


From: Daniel Rosen
Subject: RE: Automatic octaves
Date: Fri, 10 Jan 2014 18:56:06 +0000

> -----Original Message-----
> From: David Kastrup [mailto:address@hidden
> Sent: Friday, January 10, 2014 12:19 PM
> To: Daniel Rosen
> Cc: Eluze; address@hidden
> Subject: Re: Automatic octaves
> 
> Daniel Rosen <address@hidden> writes:
> 
> >> -----Original Message-----
> >> From: David Kastrup [mailto:address@hidden
> >> Sent: Friday, January 10, 2014 11:31 AM
> >> To: Daniel Rosen
> >> Cc: Eluze; address@hidden
> >> Subject: Re: Automatic octaves
> >>
> >> You could use dak's most elegant make-relative macro...
> >>
> >> myoctavate =
> >> #(define-music-function (parser location music) (ly:music?)
> >>   (make-relative (music) music
> >>     #{ \context Bottom << $music \transpose c c' $music >> #}))
> >>
> >> \relative { \myoctavate { a b c d } e f g a }
> >
> > That gets me the attached output.
> 
> Sick.  But you'll get something similar with \relative { { << { a b c d } >> 
> } e f g a
> }
> 
> The \context Bottom helps to avoid the effect in the macro itself but does
> not manage to extent its effect beyond itself.  I don't have anything to offer
> that would work better, so you just have to use explicit contexts, like
> 
> 
> \relative \new Voice { \myoctavate { a b c d } e f g a }
> 
> 
> --
> David Kastrup

Kieren's solution worked fine:

\version "2.18.0"
myoctavate =
#(define-music-function (parser location music) (ly:music?)
  #{ \context Bottom << $music \transpose c c' \relative $music >> #})

\relative { \myoctavate { a b c d } e f g a }

DR



reply via email to

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