lilypond-user
[Top][All Lists]
Advanced

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

Re: Function or command to omit only certain accidentals of a chord?


From: Stefano Troncaro
Subject: Re: Function or command to omit only certain accidentals of a chord?
Date: Thu, 1 Feb 2018 12:59:22 -0300

@Caagr98
If you could be a bit more specific about your goal (hiding all sharps? Hiding accidentals on even-indexed notes? Hiding accidentals specifically on cis?), that would make it possible to make a more specific function for your goals.

(Note that this function can only be used inline, so it won't work with edition-engraver or similar.)


You are right, I apologize for being so vague. Ideally, I wanted a function that I could use with the edition-engraver to tweak target elements inside chords. I framed the question around accidentals in the post above, but ultimately I hoped to be able to use the same function (or a very similar one) to tweak ties of specific notes instead of being forced to use one override for the whole chord, or to tweak other properties of specific notes should the need arise.

I know I can achieve the results I want by splitting the chord into Voices, and then targetting the specific note is trivial, as follows:

\version "2.19.80"
\language "english"

\include "oll-core/package.ily"
\loadPackage edition-engraver
\addEdition test

\editionMod test 1 1/4 Voice.B \once \omit Accidental

\consistToContexts #edition-engraver Voice

\score {
  \new Staff {
    \new Voice \relative c'' { 
      \key b \minor \accidentalStyle modern
      \partial 4 <as c,>4 |
      <b b,> << { \voiceOne a } \new Voice { \voiceOne cs, } >> \oneVoice <g' d~> <fs d> 
    }
  }
}
But having to split chords like this every time there is an single element I need to tweak is something I am not happy with. Having a function do it would be both cleaner and more productive.

I hope I was clear enough this time. Please tell me if you know or have any idea on how this could be achieved.

Thank you for your help!


@David
But you also can use stuff like

\once \accidentalStyle forget

I think to similar effect.


 Thank you for the suggestion. Unfortunately, if you read my reply to Caarg98 you'll notice that I'm looking for something more flexible. That is, unless one could define a custom accidental style that allowed for the precision I need, then that could actually be a great solution! But I'm unaware of how to do something like that (if it's even possible).

2018-01-31 19:24 GMT-03:00 David Kastrup <address@hidden>:
Stefano Troncaro <address@hidden> writes:

> Hello again everyone!
>
> Suppose I have the following example:
>
> \version "2.19.80"\language "english"
> command = {
>   %What should go here to omit the sharp while keeping the natural?}
> \score {
>   \new Staff {
>     \new Voice \relative c'' {
>       \key b \minor \accidentalStyle modern
>       \partial 4 <as c,> |
>       <b b,> \command <a cs,> <g d~> <fs d>
>     }
>   }
> }
>
> If for whatever reason I wanted to omit the sharp while keeping the natural
> sign of the <a cs,>, obviously \once \omit Accidental won't work. I'm at a
> loss as to how to tackle this problem, and looking through the
> documentation hasn't helped.
>
> Does anyone have an idea?



But you also can use stuff like

\once \accidentalStyle forget

I think to similar effect.

--
David Kastrup



reply via email to

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