[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Changing notehead sizes within chords
From: |
Thomas Morley |
Subject: |
Re: Changing notehead sizes within chords |
Date: |
Mon, 29 Jun 2015 23:43:32 +0200 |
2015-06-29 23:16 GMT+02:00 Klaus Blum <address@hidden>:
> Hi David,
>
> you could start a new voice like this:
> \new Voice % add this line...
> \leadVoice
> but this will lead to new problems: an additional slur and warnings about
> colliding note columns.
>
> Overriding the notehead size will always work for the entire chord. That's
> why only the tweak will work on single note heads.
>
> You can write a function just to abbreviate the multiple tweaks:
>
> % -----------------------------------------------------
>
> \version "2.18.2"
>
> t = #(define-music-function (parser location music) (ly:music?)
> #{ \tweak font-size #-3 #music #})
>
> %% Lead voice with backing harmony voices
>
> leadVoice = \relative c'' { c4( d e2 ) }
> bkgdVoiceI = \relative c'' { \t g4( \t b \t c2 ) }
> bkgdVoiceII = \relative c'' { \t e4( \t f \t g2 ) }
>
> %% Desired output
>
> \new Voice \relative c'' {
> <\tweak font-size #-3 g c \tweak font-size #-3 e >4(
> <\tweak font-size #-3 b d \tweak font-size #-3 f >
> <\tweak font-size #-3 c e \tweak font-size #-3 g >2 )
> }
>
> %% Actual output
>
> \new Voice <<
> \bkgdVoiceII
> \leadVoice
> \bkgdVoiceI
>>>
>
> % -----------------------------------------------------
>
> Maybe there's a way to have a function tweak all the notes in a music
> expression, but that's far beyond my scheme knowledge.
>
> Cheers,
> Klaus
Maybe:
\version "2.18.2"
font-size-tweak =
#(define-music-function (parser location music) (ly:music?)
(map-some-music
(lambda (m)
(and (music-is-of-type? m 'note-event)
#{ \tweak font-size #-3 $m #}))
music))
leadVoice = \relative c'' { c4( d e2 ) }
bkgdVoiceI = \relative c'' { g4( b c2 ) }
bkgdVoiceII = \relative c'' { e4( f g2 ) }
\new Voice
<<
\font-size-tweak \bkgdVoiceII
\leadVoice
\font-size-tweak \bkgdVoiceI
>>
HTH,
Harm