Accidental style with brief changes of clef.

2024-09-06 Thread Nick Bailey
I'm aware that this has been discussed before at 
https://lists.nongnu.org/archive/html/lilypond-user/2015-10/msg00678.html 
 
and 
https://lists.nongnu.org/archive/html/lilypond-user/2015-10/msg00668.html 
 
but we are busy engraving a performance edition of a composer who 
routinely expects scores like this:


\version "2.22.0"
\score {
  \new Staff
    { \clef bass cis'4 \clef treble cis' \clef bass cis' }
  \layout {}
}

_not_ to have a sharp sign on the final note. The desired outcome is 
that a new clef does get an accidental but that when the melodic line 
returns to the bass clef, the accidentals from the original bass clef in 
the same staff and bar are retained. You would see #C #C C on the paper. 
Apparently, this practice is particularly common in keyboard scores 
which traverse a large distance up and down the keyboard, changing clefs 
twice in the same bar. In some conventions, it's as if the second bass 
clef indicates a return to the accidentals current just before the 
treble clef rather than just forgetting them all. This is news to me, 
but I've not been writing and performing piano music for decades.


This isn't a question about whether that's "right"; I understand the 
choice of behaviour for the accidental styles based on the statement in 
Gould's book. The question is how best to achieve it. Currently we'd 
enter \once \omit Accidental before the final notes/chords (which I 
suppose could be abbreviated). This isn't convenient, rendering the 
input file too verbose, and is error prone because if a note is changed 
a required accidental might be omitted by mistake.


What would be really nice would be either to have a custom 
accidentalStyle, or else an easy way of omitting the accidental which is 
part of the note by adding a suffix, so that in the same way cis! forces 
the accidental to appear, cis@, for example, forces it not to. Either of 
these strike me as something quite major, but I thought I should canvas 
opinion on the list in case they aren't. Or perhaps they've already been 
done.


Here's a less-than-minimum working example some real music to show where 
accidentals are deliberately omitted at the moment beginning and ending 
in the treble clef, 4/4 time. Without the \omits, the last beat is full 
of repeated naturals in any of the accidentalStyles I know about.


%measure 2 ==
16 \mp   
\clef bass
   
\clef treble \once \omit Accidental 
\once \omit Accidental 
\once \omit Accidental  


Re: Default accidental style for PianoStaff

2021-08-20 Thread Knute Snortum
On Thu, Aug 19, 2021 at 12:01 PM Jean Abou Samra  wrote:
> If you can do a merge request to fix it
> directly, that's even better. Look up the
> contributing instructions at
>
> http://lilypond.org/doc/v2.23/Documentation/contributor/working-with-source-code
>
> (if your change is small enough, you can rely
> on the automated testing system to check the
> Texinfo syntax; no need to compile the documentation
> yourself then).
>
> Thanks,
> Jean

Thanks for the tip. I will try to do that at a later date.  I'm
currently in a project that I don't want to interrupt, so I'm entering
the issue so I don't forget what to do.

--
Knute Snortum



Re: Default accidental style for PianoStaff

2021-08-19 Thread Jean Abou Samra




Le 19/08/2021 à 20:48, Knute Snortum a écrit :

On Wed, Aug 18, 2021 at 10:25 AM David Wright  wrote:

On Wed 18 Aug 2021 at 18:18:04 (+0200), Jean Abou Samra wrote:

Le 18/08/2021 à 17:23, Knute Snortum a écrit :

That clarifies things, thanks.

What would you think about changing the documentation to say something
like, "If this accidental style is applied to a Staff, it will apply
to all staves within the enclosing PianoStaff or GrandStaff"?

It would be nice to reword this passage. "If this
accidental style is applied to a Staff" does not
exactly reflect what is happening, though: the
accidental style never goes through the Staff, but
jumps to the GrandStaff directly. In other words,

\accidentalStyle piano

is equivalent to

\accidentalStyle GrandStaff.piano

whereas

\accidentalStyle default

is the same as

\accidentalStyle Staff.default

How to phrase this in a way that would make it
clear to you?

When I looked at the paragraph in question:

"This accidental style applies to the current GrandStaff or PianoStaff by 
default"

I wasn't immediately clear about what "default" implied,
particularly as "default" is also the defined name of one of the
types of automatic accidental style being discussed in this section.
(There are references to the name "default" scattered throughout
the section.)

So I would suggest that the wording be made more explicit:

   "This accidental style applies to the current GrandStaff or PianoStaff
unless qualified in scope with a second argument."

Ditto for:

   "This accidental style applies to the current ChoirStaff
unless qualified in scope with a second argument."

I would also suggest changing the paragraph near the start of the
section to eliminate "default" there as well:

   "The accidental style normally applies to the current Staff
(with the exception of the styles

choral,   ← this addition was overlooked

piano and piano-cautionary, which are explained below).
Optionally, the function can take a second argument that
determines in which scope the style should be changed.
For example, …"

Cheers,
David.

Thanks David.  Is it okay if I turn your suggestion into a LIlyPond
Issue?  Or would you rather do that?


If you can do a merge request to fix it
directly, that's even better. Look up the
contributing instructions at

http://lilypond.org/doc/v2.23/Documentation/contributor/working-with-source-code

(if your change is small enough, you can rely
on the automated testing system to check the
Texinfo syntax; no need to compile the documentation
yourself then).

Thanks,
Jean



Re: Default accidental style for PianoStaff

2021-08-19 Thread Knute Snortum
On Wed, Aug 18, 2021 at 10:25 AM David Wright  wrote:
>
> On Wed 18 Aug 2021 at 18:18:04 (+0200), Jean Abou Samra wrote:
> > Le 18/08/2021 à 17:23, Knute Snortum a écrit :
> > > That clarifies things, thanks.
> > >
> > > What would you think about changing the documentation to say something
> > > like, "If this accidental style is applied to a Staff, it will apply
> > > to all staves within the enclosing PianoStaff or GrandStaff"?
> >
> > It would be nice to reword this passage. "If this
> > accidental style is applied to a Staff" does not
> > exactly reflect what is happening, though: the
> > accidental style never goes through the Staff, but
> > jumps to the GrandStaff directly. In other words,
> >
> > \accidentalStyle piano
> >
> > is equivalent to
> >
> > \accidentalStyle GrandStaff.piano
> >
> > whereas
> >
> > \accidentalStyle default
> >
> > is the same as
> >
> > \accidentalStyle Staff.default
> >
> > How to phrase this in a way that would make it
> > clear to you?
>
> When I looked at the paragraph in question:
>
> "This accidental style applies to the current GrandStaff or PianoStaff by 
> default"
>
> I wasn't immediately clear about what "default" implied,
> particularly as "default" is also the defined name of one of the
> types of automatic accidental style being discussed in this section.
> (There are references to the name "default" scattered throughout
> the section.)
>
> So I would suggest that the wording be made more explicit:
>
>   "This accidental style applies to the current GrandStaff or PianoStaff
>unless qualified in scope with a second argument."
>
> Ditto for:
>
>   "This accidental style applies to the current ChoirStaff
>unless qualified in scope with a second argument."
>
> I would also suggest changing the paragraph near the start of the
> section to eliminate "default" there as well:
>
>   "The accidental style normally applies to the current Staff
>(with the exception of the styles
>
>choral,   ← this addition was overlooked
>
>piano and piano-cautionary, which are explained below).
>Optionally, the function can take a second argument that
>determines in which scope the style should be changed.
>For example, …"
>
> Cheers,
> David.

Thanks David.  Is it okay if I turn your suggestion into a LIlyPond
Issue?  Or would you rather do that?

--
Knute Snortum



Re: Default accidental style for PianoStaff

2021-08-18 Thread David Wright
On Wed 18 Aug 2021 at 18:18:04 (+0200), Jean Abou Samra wrote:
> Le 18/08/2021 à 17:23, Knute Snortum a écrit :
> > That clarifies things, thanks.
> > 
> > What would you think about changing the documentation to say something
> > like, "If this accidental style is applied to a Staff, it will apply
> > to all staves within the enclosing PianoStaff or GrandStaff"?
> 
> It would be nice to reword this passage. "If this
> accidental style is applied to a Staff" does not
> exactly reflect what is happening, though: the
> accidental style never goes through the Staff, but
> jumps to the GrandStaff directly. In other words,
> 
> \accidentalStyle piano
> 
> is equivalent to
> 
> \accidentalStyle GrandStaff.piano
> 
> whereas
> 
> \accidentalStyle default
> 
> is the same as
> 
> \accidentalStyle Staff.default
> 
> How to phrase this in a way that would make it
> clear to you?

When I looked at the paragraph in question:

"This accidental style applies to the current GrandStaff or PianoStaff by 
default"

I wasn't immediately clear about what "default" implied,
particularly as "default" is also the defined name of one of the
types of automatic accidental style being discussed in this section.
(There are references to the name "default" scattered throughout
the section.)

So I would suggest that the wording be made more explicit:

  "This accidental style applies to the current GrandStaff or PianoStaff
   unless qualified in scope with a second argument."

Ditto for:

  "This accidental style applies to the current ChoirStaff
   unless qualified in scope with a second argument."

I would also suggest changing the paragraph near the start of the
section to eliminate "default" there as well:

  "The accidental style normally applies to the current Staff
   (with the exception of the styles

   choral,   ← this addition was overlooked

   piano and piano-cautionary, which are explained below).
   Optionally, the function can take a second argument that
   determines in which scope the style should be changed.
   For example, …"

Cheers,
David.



Re: Default accidental style for PianoStaff

2021-08-18 Thread Jean Abou Samra

Le 18/08/2021 à 17:23, Knute Snortum a écrit :

That clarifies things, thanks.

What would you think about changing the documentation to say something
like, "If this accidental style is applied to a Staff, it will apply
to all staves within the enclosing PianoStaff or GrandStaff"?


It would be nice to reword this passage. "If this
accidental style is applied to a Staff" does not
exactly reflect what is happening, though: the
accidental style never goes through the Staff, but
jumps to the GrandStaff directly. In other words,

\accidentalStyle piano

is equivalent to

\accidentalStyle GrandStaff.piano

whereas

\accidentalStyle default

is the same as

\accidentalStyle Staff.default

How to phrase this in a way that would make it
clear to you?

Thanks,
Jean



Re: Default accidental style for PianoStaff

2021-08-18 Thread Knute Snortum
On Tue, Aug 17, 2021 at 4:15 PM David Kastrup  wrote:
>
> Knute Snortum  writes:
>
> > Hello community,
> >
> > I think I've found an inconsistency between the 2.22 documentation and
> > LilyPond's actual behavior.  If you go to the Automatic Accidental
> > page...
> >
> > https://lilypond.org/doc/v2.22/Documentation/notation/displaying-pitches#automatic-accidentals
> >
> > ...and scroll down the "piano" section, you will see this sentence:
> >
> > "This accidental style applies to the current GrandStaff or PianoStaff
> > by default."
[example snipped]
>
> Yes.  The default accidental style is not piano.  But if you specify
> \accidentalStyle piano, it will apply to the current
> PianoStaff/GrandStaff context as opposed to other accidental styles
> which only apply to the current Staff.

That clarifies things, thanks.

What would you think about changing the documentation to say something
like, "If this accidental style is applied to a Staff, it will apply
to all staves within the enclosing PianoStaff or GrandStaff"?



Re: Default accidental style for PianoStaff

2021-08-17 Thread David Kastrup
Knute Snortum  writes:

> Hello community,
>
> I think I've found an inconsistency between the 2.22 documentation and
> LilyPond's actual behavior.  If you go to the Automatic Accidental
> page...
>
> https://lilypond.org/doc/v2.22/Documentation/notation/displaying-pitches#automatic-accidentals
>
> ...and scroll down the "piano" section, you will see this sentence:
>
> "This accidental style applies to the current GrandStaff or PianoStaff
> by default."
>
> But that's not the case.  Here is a fairly minimal working example:
>
> %%%
> \version "2.22.1"
> \language "english"
>
> rightHand = \relative {
>   \time 2/4
>   | g8 [ c af df ]
>   | a8 [ d bf ef ]
> }
> leftHand = \relative {
>   \time 2/4
>   \clef bass
>   | 8 []
>   | 8 []
> }
>
> \new PianoStaff <<
>   \new Staff \rightHand
>   \new Staff \leftHand
>>>
>
> \new PianoStaff <<
>   \accidentalStyle piano
>   \new Staff \rightHand
>   \new Staff \leftHand
>>>
> %%%
>
> On the first staff, the A and D in the second measure do not have a
> cautionary natural sign but in the second, it does.  This shows that
> the default accidental style is not "piano".  Am I missing anything?

Yes.  The default accidental style is not piano.  But if you specify
\accidentalStyle piano, it will apply to the current
PianoStaff/GrandStaff context as opposed to other accidental styles
which only apply to the current Staff.

Cf.

%%%
\version "2.22.1"
\language "english"

rightHand = \relative {
  \time 2/4
  | g8 [ c af df ]
  | a8 [ d bf ef ]
}
leftHand = \relative {
  \time 2/4
  \clef bass
  | 8 []
  | 8 []
}

\new PianoStaff <<
  \new Staff \rightHand
  \new Staff \leftHand
>>

\new PianoStaff <<
  \new Staff { \accidentalStyle piano \rightHand }
  \new Staff \leftHand
>>

\new PianoStaff <<
  \new Staff { \accidentalStyle dodecaphonic \rightHand }
  \new Staff \leftHand
>>

%%%



-- 
David Kastrup


Default accidental style for PianoStaff

2021-08-17 Thread Knute Snortum
Hello community,

I think I've found an inconsistency between the 2.22 documentation and
LilyPond's actual behavior.  If you go to the Automatic Accidental
page...

https://lilypond.org/doc/v2.22/Documentation/notation/displaying-pitches#automatic-accidentals

...and scroll down the "piano" section, you will see this sentence:

"This accidental style applies to the current GrandStaff or PianoStaff
by default."

But that's not the case.  Here is a fairly minimal working example:

%%%
\version "2.22.1"
\language "english"

rightHand = \relative {
  \time 2/4
  | g8 [ c af df ]
  | a8 [ d bf ef ]
}
leftHand = \relative {
  \time 2/4
  \clef bass
  | 8 []
  | 8 []
}

\new PianoStaff <<
  \new Staff \rightHand
  \new Staff \leftHand
>>

\new PianoStaff <<
  \accidentalStyle piano
  \new Staff \rightHand
  \new Staff \leftHand
>>
%%%

On the first staff, the A and D in the second measure do not have a
cautionary natural sign but in the second, it does.  This shows that
the default accidental style is not "piano".  Am I missing anything?

I think LilyPond's behavior should match the documentation, because
having the accidental style default to "piano" in a PianoStaff seems
like the expected behavior.

--
Knute Snortum


Re: Default accidental style with timing off

2020-04-23 Thread Fr. Samuel Springuel
> On 22 Apr, 2020, at 6:09 PM, Aaron Hill  wrote:
> 
> A pattern I could recommend is defining a named procedure as opposed to using 
> a lambda with \applyContext:
> 
> 
>  foo = #(define-music-function () ()
>(define (proc context)
>  (do-something-here))
>#{ \applyContext #proc #})
> 
> 
> This keeps potentially complex S-expressions outside LilyPond syntax, which 
> should improve readability.

Thanks, that does look much nicer.

> Apart from that, I would suggest simplifying your variable names.  There is 
> no need to call something "mything" when "thing" would suffice.  Remember 
> that bindings have scope; and local bindings trump.  You only need unique 
> names if you must have access to both variables.
> 
> That said, I would prefer "my-thing" over "mything".  You have to be careful 
> with smooshing words together lest they read poorly.  "curnum" is not ideal 
> as it looks like it could be a word in Latin.  "currnum" is slightly better, 
> but "curr-num" would be the preference if abbreviation is required.
> 
> Mind you, I would sidestep all that by calling it "bar-number":
> 
> 
>  (let* ((score (ly:context-find context 'Score))
> (bar-number (ly:context-property score 'internalBarNumber)))
>(ly:context-set-property! score 'internalBarNumber (1+ bar-number)))
> 
> 

Good point.  I have to admit that I wasn’t paying much attention to the 
variable names.  As I was combining things from various sources I just ported 
over the existing naming conventions without really thinking about how 
unreadable they actually were.  Cleaning up the variable names, along with the 
above change make this much easier to read and like I might have a chance of 
understanding scheme more generally.


✝✝
Fr. Samuel, OSB
(R. Padraic Springuel)
St. Anselm’s Abbey
4501 South Dakota Ave, NE
Washington, DC, 20017
202-269-2300
(c) 202-853-7036

PAX ☧ ΧΡΙΣΤΟΣ




Re: Default accidental style with timing off

2020-04-22 Thread Aaron Hill

On 2020-04-22 1:10 pm, Fr. Samuel Springuel wrote:

After some more work I came up with the attached redefinition of the
bar which does what I originally asked for.  I’d appreciate any scheme
experts critique on what I have as I’m not entirely comfortable with
the way I’m switching in and out of scheme.  It works, I’m just not
sure it’s “proper.”


Seems fine.

A pattern I could recommend is defining a named procedure as opposed to 
using a lambda with \applyContext:



  foo = #(define-music-function () ()
(define (proc context)
  (do-something-here))
#{ \applyContext #proc #})


This keeps potentially complex S-expressions outside LilyPond syntax, 
which should improve readability.


Apart from that, I would suggest simplifying your variable names.  There 
is no need to call something "mything" when "thing" would suffice.  
Remember that bindings have scope; and local bindings trump.  You only 
need unique names if you must have access to both variables.


That said, I would prefer "my-thing" over "mything".  You have to be 
careful with smooshing words together lest they read poorly.  "curnum" 
is not ideal as it looks like it could be a word in Latin.  "currnum" is 
slightly better, but "curr-num" would be the preference if abbreviation 
is required.


Mind you, I would sidestep all that by calling it "bar-number":


  (let* ((score (ly:context-find context 'Score))
 (bar-number (ly:context-property score 'internalBarNumber)))
(ly:context-set-property! score 'internalBarNumber (1+ bar-number)))



-- Aaron Hill



Re: Default accidental style with timing off

2020-04-22 Thread Fr. Samuel Springuel
After some more work I came up with the attached redefinition of the bar which 
does what I originally asked for.  I’d appreciate any scheme experts critique 
on what I have as I’m not entirely comfortable with the way I’m switching in 
and out of scheme.  It works, I’m just not sure it’s “proper.”

✝✝
Fr. Samuel, OSB
(R. Padraic Springuel)
St. Anselm’s Abbey
4501 South Dakota Ave, NE
Washington, DC, 20017
202-269-2300
(c) 202-853-7036

PAX ☧ ΧΡΙΣΤΟΣ


accidental_style.ly
Description: Binary data


Re: Default accidental style with timing off

2020-04-06 Thread Fr. Samuel Springuel
I’ve been playing with this further and have come up with the attached.  Now, 
can someone tell me how I might combine \test and \bar into a redefined \bar 
(so that I don’t have to have both \test and \bar in all bar locations)?  My 
naive expectation would have been `bar = \test \bar \etc` but this raises and 
“unexpected \etc” error.

✝✝
Fr. Samuel, OSB
(R. Padraic Springuel)
St. Anselm’s Abbey
4501 South Dakota Ave, NE
Washington, DC, 20017
202-269-2300
(c) 202-853-7036

PAX ☧ ΧΡΙΣΤΟΣ


accidental_style.ly
Description: Binary data


Re: Default accidental style with timing off

2020-03-27 Thread Fr. Samuel Springuel
> On 26 Mar, 2020, at 7:50 PM, Mark Stephen Mrotek  wrote:
> 
> Fr. Samuel.
> 
> 1) The bar instructions are in printer's (curly) double quotes.

Sorry about that, my email client must have mangled them as they aren’t that 
way in the original document.  I’ve attached the original below.

> 2) The timing = ##f may be incorrectly written/located. See: 
> http://lilypond.org/doc/v2.19/Documentation/learning/gregorian-transcription-template.

That line is equivalent to the \set Score.timing = ##f in that template, just 
relocated to a context definition so as to facilitate putting all the settings 
in one place.  I don’t like that template because of how it scatters the 
settings in three places (a layout block which redefines several context 
defaults, the \include statement, and the aforementioned \set statement) and so 
I’m writing my own.  My intention is to have a single include file that will 
apply *all* the necessary changes when used.  I’m also trying to eliminate the 
\divisio… concept of gregorian.ly and instead using the more usual \bar 
mechanism.

I’ll point out, however that the indicated template has the same problems with 
accidentals.


✝✝
Fr. Samuel, OSB
(R. Padraic Springuel)
St. Anselm’s Abbey
4501 South Dakota Ave, NE
Washington, DC, 20017
202-269-2300
(c) 202-853-7036

PAX ☧ ΧΡΙΣΤΟΣ


accidental_style.ly
Description: Binary data


RE: Default accidental style with timing off

2020-03-26 Thread Mark Stephen Mrotek
Fr. Samuel.

1) The bar instructions are in printer's (curly) double quotes.
2) The timing = ##f may be incorrectly written/located. See: 
http://lilypond.org/doc/v2.19/Documentation/learning/gregorian-transcription-template.

Mark

-Original Message-
From: lilypond-user [mailto:lilypond-user-bounces+carsonmark=ca.rr@gnu.org] 
On Behalf Of Fr. Samuel Springuel
Sent: Thursday, March 26, 2020 1:53 PM
To: lilypond-user@gnu.org
Subject: Default accidental style with timing off

When constructing scores where the timing is turned off, how do I get 
accidentals to behave with respect to the manually inserted bar lines?  I’m 
just looking for the default accidental style (accidentals “last” until a bar 
line), it’s just that all bar lines are inserted manually using \bar.

 MWE

\version "2.19.84"

\layout {
\context {
\Score
timing = ##f
}
}

music = {
f' fes' \bar “|” % flat on second note
fes' fes' \bar “|” % should be flat on first note, nothing on second
fes' f' \bar “|” % should be flat on first note, natural on second
f' fes' \bar “|” % flat on second note
f' fes' \bar “|” % should be nothing on first note, flat on second }

\new Staff { \music }

✝✝
Fr. Samuel, OSB
(R. Padraic Springuel)
St. Anselm’s Abbey
4501 South Dakota Ave, NE
Washington, DC, 20017
202-269-2300
(c) 202-853-7036

PAX ☧ ΧΡΙΣΤΟΣ





Default accidental style with timing off

2020-03-26 Thread Fr. Samuel Springuel
When constructing scores where the timing is turned off, how do I get 
accidentals to behave with respect to the manually inserted bar lines?  I’m 
just looking for the default accidental style (accidentals “last” until a bar 
line), it’s just that all bar lines are inserted manually using \bar.

 MWE

\version "2.19.84"

\layout {
\context {
\Score
timing = ##f
}
}

music = {
f' fes' \bar “|” % flat on second note
fes' fes' \bar “|” % should be flat on first note, nothing on second
fes' f' \bar “|” % should be flat on first note, natural on second
f' fes' \bar “|” % flat on second note
f' fes' \bar “|” % should be nothing on first note, flat on second
}

\new Staff { \music }

✝✝
Fr. Samuel, OSB
(R. Padraic Springuel)
St. Anselm’s Abbey
4501 South Dakota Ave, NE
Washington, DC, 20017
202-269-2300
(c) 202-853-7036

PAX ☧ ΧΡΙΣΤΟΣ




Re: Adding a new accidental style

2019-04-14 Thread Thomas Morley
Am So., 14. Apr. 2019 um 17:22 Uhr schrieb Edward Lilley :
>
> Dear all,
>
> I am trying extend Lilypond in Scheme to add a new accidental
> style. What I am currently stuck on is how to add a new item to the
> "accidental-styles" alist in such a way that it is visible to the
> \accidentalStyle command.
>
> I have a file called "hist-accidentals.scm" that contains the following:
>
> > (define-public (hist-accidental-rule context pitch barnum measurepos)
> >   "An accidental rule that only typesets sharps and flats, indicating
> >   relative alteration compared to the key signature."
> >   (let* ((keysig (ly:context-property context 'localAlterations))
> >   (entry (find-pitch-entry keysig pitch #t #t)))
> >   (if (not entry)
> >   (cons #f #f)
> >   (let* ((global-entry (find-pitch-entry keysig pitch #f #f))
> >   (key-acc (key-entry-alteration global-entry))
> >   (acc (ly:pitch-alteration pitch))
> >   (entrymp (key-entry-measure-position entry))
> >   (entrybn (key-entry-bar-number entry)))
> >   (cons #f (not (or (equal? acc key-acc)
> >   (and (equal? entrybn barnum) (equal?
> >   entrymp measurepos)
> >
> > (set! accidental-styles
> > (cons hist #f
> > (Staff ,(make-accidental-rule 'same-octave 0))
> > (Staff ,(make-accidental-rule 'same-octave 1)
> > hist-accidental-rule)))
> > accidental-styles))
>
> (currently the contents of "hist-accidental-rule" is just a copy of the
> "teaching" accidental style)
>
> At the top of the relevant lilypond file, I load the scheme file with
>
> > #(load "hist-accidentals.scm")
>
> But when I come to write
>
> > \accidentalStyle hist
>
> later on, lilypond complains with "warning: unknown accidental style:
> hist". How do I modify variables defined using "define-public"? Or, what
> should I be doing instead?
>
> Thanks,
> Edward

Hi,

please attach the file in future: From here it looks like the syntax
is messed up for brackets/semiquotes and unquotes.
It's not unheard some email-client done such things, though ...

Anyway, below should do:

(set! accidental-styles
  (cons
`(hist #f
   (Staff ,(make-accidental-rule 'same-octave 0))
   (Staff ,(make-accidental-rule 'same-octave 1)
  ,hist-accidental-rule))
accidental-styles))

Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Adding a new accidental style

2019-04-14 Thread Edward Lilley
Dear all,

I am trying extend Lilypond in Scheme to add a new accidental
style. What I am currently stuck on is how to add a new item to the
"accidental-styles" alist in such a way that it is visible to the
\accidentalStyle command.

I have a file called "hist-accidentals.scm" that contains the following:

> (define-public (hist-accidental-rule context pitch barnum measurepos)
>   "An accidental rule that only typesets sharps and flats, indicating
>   relative alteration compared to the key signature."
>   (let* ((keysig (ly:context-property context 'localAlterations))
>   (entry (find-pitch-entry keysig pitch #t #t)))
>   (if (not entry)
>   (cons #f #f)
>   (let* ((global-entry (find-pitch-entry keysig pitch #f #f))
>   (key-acc (key-entry-alteration global-entry))
>   (acc (ly:pitch-alteration pitch))
>   (entrymp (key-entry-measure-position entry))
>   (entrybn (key-entry-bar-number entry)))
>   (cons #f (not (or (equal? acc key-acc)
>   (and (equal? entrybn barnum) (equal?
>   entrymp measurepos)
> 
> (set! accidental-styles
> (cons hist #f
> (Staff ,(make-accidental-rule 'same-octave 0))
> (Staff ,(make-accidental-rule 'same-octave 1)
> hist-accidental-rule)))
> accidental-styles))

(currently the contents of "hist-accidental-rule" is just a copy of the
"teaching" accidental style)

At the top of the relevant lilypond file, I load the scheme file with

> #(load "hist-accidentals.scm")

But when I come to write

> \accidentalStyle hist

later on, lilypond complains with "warning: unknown accidental style:
hist". How do I modify variables defined using "define-public"? Or, what
should I be doing instead?

Thanks,
Edward



-- 

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Accidental style in presence of mid-bar line breaks.

2018-06-28 Thread Richard Shann
On Thu, 2018-06-28 at 14:52 +0100, Richard Shann wrote:
> On Thu, 2018-06-28 at 09:09 +0100, Richard Shann wrote:
> > On Wed, 2018-06-27 at 17:00 +0200, Simon Albrecht wrote:
> > > On 26.06.2018 09:11, Richard Shann wrote:
> > > > In this connection, I noticed that LilyPond skips printing the
> > > > bar
> > > > number at the beginning of each line if the bar is being split
> > > > over
> > > > a
> > > > line.
> > > 
> > > That’s configurable:
> > > 
> > > %%%
> > > \version "2.19.80"
> > > 
> > > \layout {
> > >    \context {
> > >  \Score
> > >  barNumberVisibility = #(every-nth-bar-number-visible 1)
> > >  \override BarNumber.break-visibility = #begin-of-line-
> > > visible
> > >    }
> > > }
> > > 
> > > {
> > >    1 2 \bar "" \break 2
> > > }
> > > %%%
> > > 
> > 
> > Thanks - that's useful, I've added it to Denemo's "Allow breaks at
> > half
> > bar" command. It also suggests that if I look for where the
> > parenthesized measure numbers are generated in LilyPond's sources I
> > might be able to trigger a warning to the user that a bar has been
> > broken, and they (or Denemo) can look for possible repeat
> > accidentals
> > to add.
> 
> I've had a go at finding where the "(" is added to the bar number
> markup and found that 
> 
> \version "2.19.43"
> 
> #(define-public ((every-nth-bar-number-visible n) barnum mp)
>    (display "\n\n\nhello\n\n\n")
>   (= 0 (modulo barnum n)))
> 
> \layout {
>    \context {
>  \Score
>  barNumberVisibility = #(every-nth-bar-number-visible 1)
>  \override BarNumber.break-visibility = #begin-of-line-visible
>    }
> }
> 
> {
>    a1 a2 \bar "" \break a2
> }
> 
> Does issue "hello" on standard out, so I could issue a warning there,
> but the only place the "(" seems to be added is at
> 
> (define-public (robust-bar-number-function ...)
> 
> in scm/translation-functions.scm 
> 
> and this procedure does *not* seemed to be called in compiling that
> example. Anyone any clues about where in the source code the "(" is
> added to a bar numbering?

Ha!
I find that the following code

\version "2.19.43"

#(define-public ((every-nth-bar-number-visible n) barnum mp)
   (if (positive? (ly:moment-main-numerator mp))
   (format #t "Warning bar ~A is broken\n" barnum))
  (= 0 (modulo barnum n)))

\layout {
   \context {
 \Score
 barNumberVisibility = #(every-nth-bar-number-visible 1)
 \override BarNumber.break-visibility = #begin-of-line-visible
   }
}

{
  
   a1 a2 \bar "" \break a2  a1  
}

Gives the needed warning when a bar is broken, but I guess it is not
going to be possible to identify which \score {} block the mid bar
break occurred ... The user knows a bar number n has been broken, but
not which movement that was in.

Richard






___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Accidental style in presence of mid-bar line breaks.

2018-06-28 Thread Richard Shann
On Thu, 2018-06-28 at 09:09 +0100, Richard Shann wrote:
> On Wed, 2018-06-27 at 17:00 +0200, Simon Albrecht wrote:
> > On 26.06.2018 09:11, Richard Shann wrote:
> > > In this connection, I noticed that LilyPond skips printing the
> > > bar
> > > number at the beginning of each line if the bar is being split
> > > over
> > > a
> > > line.
> > 
> > That’s configurable:
> > 
> > %%%
> > \version "2.19.80"
> > 
> > \layout {
> >    \context {
> >  \Score
> >  barNumberVisibility = #(every-nth-bar-number-visible 1)
> >  \override BarNumber.break-visibility = #begin-of-line-visible
> >    }
> > }
> > 
> > {
> >    1 2 \bar "" \break 2
> > }
> > %%%
> > 
> 
> Thanks - that's useful, I've added it to Denemo's "Allow breaks at
> half
> bar" command. It also suggests that if I look for where the
> parenthesized measure numbers are generated in LilyPond's sources I
> might be able to trigger a warning to the user that a bar has been
> broken, and they (or Denemo) can look for possible repeat accidentals
> to add.

I've had a go at finding where the "(" is added to the bar number
markup and found that 

\version "2.19.43"

#(define-public ((every-nth-bar-number-visible n) barnum mp)
   (display "\n\n\nhello\n\n\n")
  (= 0 (modulo barnum n)))

\layout {
   \context {
 \Score
 barNumberVisibility = #(every-nth-bar-number-visible 1)
 \override BarNumber.break-visibility = #begin-of-line-visible
   }
}

{
   a1 a2 \bar "" \break a2
}

Does issue "hello" on standard out, so I could issue a warning there,
but the only place the "(" seems to be added is at

(define-public (robust-bar-number-function ...)

in scm/translation-functions.scm 

and this procedure does *not* seemed to be called in compiling that
example. Anyone any clues about where in the source code the "(" is
added to a bar numbering?

Richard



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Accidental style in presence of mid-bar line breaks.

2018-06-28 Thread Richard Shann
On Wed, 2018-06-27 at 17:00 +0200, Simon Albrecht wrote:
> On 26.06.2018 09:11, Richard Shann wrote:
> > In this connection, I noticed that LilyPond skips printing the bar
> > number at the beginning of each line if the bar is being split over
> > a
> > line.
> 
> That’s configurable:
> 
> %%%
> \version "2.19.80"
> 
> \layout {
>    \context {
>  \Score
>  barNumberVisibility = #(every-nth-bar-number-visible 1)
>  \override BarNumber.break-visibility = #begin-of-line-visible
>    }
> }
> 
> {
>    1 2 \bar "" \break 2
> }
> %%%
> 

Thanks - that's useful, I've added it to Denemo's "Allow breaks at half
bar" command. It also suggests that if I look for where the
parenthesized measure numbers are generated in LilyPond's sources I
might be able to trigger a warning to the user that a bar has been
broken, and they (or Denemo) can look for possible repeat accidentals
to add.

Richard


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Accidental style in presence of mid-bar line breaks.

2018-06-27 Thread Simon Albrecht

On 26.06.2018 09:11, Richard Shann wrote:

In this connection, I noticed that LilyPond skips printing the bar
number at the beginning of each line if the bar is being split over a
line.


That’s configurable:

%%%
\version "2.19.80"

\layout {
  \context {
    \Score
    barNumberVisibility = #(every-nth-bar-number-visible 1)
    \override BarNumber.break-visibility = #begin-of-line-visible
  }
}

{
  1 2 \bar "" \break 2
}
%%%

Best, Simon

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Accidental style in presence of mid-bar line breaks.

2018-06-26 Thread Richard Shann
On Mon, 2018-06-25 at 22:48 +0200, Simon Albrecht wrote:
> On 25.06.2018 13:25, Richard Shann wrote:
> > In 18th c. mss and prints it is quite common to create line breaks
> > during bars - I've found this much improves the legibility of some
> > florid slow movements.
> > 
> > However, it seems that the available accidental styles only take
> > account of barlines and ignore line breaks,
> 
> It’s not what you ask for, but of course in the 18th century
> accidentals 
> generally pertained only to one note and its immediate repetitions – 
> with exceptions according to common sense. Except for the exceptions 
> this can be modelled very well using a LilyPond accidental style –
> see 
> attachment.

Thank you very much for this code - it affords a good guide to the sort
of thing you can do to add accidental styles.  

As you observe it's not what I asked for, going rather in the direction
of mimicking old prints rather than easing the task for the modern
reader of the old music. (OT : I've had fun playing from facsimiles and
the biggest problems are not accidental style but the lack of alignment
of parts between barlines and - killer - the joining up of ledger lines
which makes the top line of the staff appear higher than it is.
Evidence that until the 19th c. musicians played by interval rather
than position - see https://www.jstor.org/stable/841141?refreqid=robots
txt-
sitemaps:b3d7f2442648678c96dec5651ef07226&seq=1#page_scan_tab_contents
for this old story).

Anyway, back to the topic: even if it's not possible to coax LilyPond
to flag up when it takes advantage of \bar "" to break a line, it would
help if it could emit a list of line-breaks - in what form I'm not sure
- that could be post-processed to determine if an a bar was split. (For
example if it could print the bar number before and after each line
break). 

In this connection, I noticed that LilyPond skips printing the bar
number at the beginning of each line if the bar is being split over a
line. This is better than the behavior you can see in another program
(Finale? Sib?) at 
https://imslp.org/wiki/Special:ImagefromIndex/323673
where the split bar gets assigned *two* bar numbers!

Thanks again for your engagement in this problem!

Richard


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Accidental style in presence of mid-bar line breaks.

2018-06-25 Thread Simon Albrecht

On 25.06.2018 13:25, Richard Shann wrote:

In 18th c. mss and prints it is quite common to create line breaks
during bars - I've found this much improves the legibility of some
florid slow movements.

However, it seems that the available accidental styles only take
account of barlines and ignore line breaks,


It’s not what you ask for, but of course in the 18th century accidentals 
generally pertained only to one note and its immediate repetitions – 
with exceptions according to common sense. Except for the exceptions 
this can be modelled very well using a LilyPond accidental style – see 
attachment.


Best, Simon
\version "2.19.35"
%% LOCAL FUNCTIONS FROM scm/music-functions.scm
%%{
#(define (key-entry-notename entry)
   "Return the pitch of an @var{entry} in @code{localKeySignature}.
  The @samp{car} of the entry is either of the form @code{notename} or
of the form @code{(octave . notename)}.  The latter form is used for special
key signatures or to indicate an explicit accidental.

The @samp{cdr} of the entry is either a rational @code{alter} indicating
a key signature alteration, or of the form
@code{(alter . (barnum . measurepos))} indicating an alteration caused by
an accidental in music."
   (if (pair? (car entry))
   (cdar entry)
   (car entry)))

#(define (key-entry-octave entry)
   "Return the octave of an entry in @code{localKeySignature}
  or @code{#f} if the entry does not have an octave.
See @code{key-entry-notename} for details."
   (and (pair? (car entry)) (caar entry)))

#(define (key-entry-alteration entry)
   "Return the alteration of an entry in localAlterations

For convenience, returns @code{0} if entry is @code{#f}."
   (if entry
   (if (number? (cdr entry))
   (cdr entry)
   (cadr entry))
   0))

#(define (key-entry-bar-number entry)
   "Return the bar number of an entry in @code{localKeySignature}
  or @code {#f} if the entry does not have a bar number.
See @code{key-entry-notename} for details."
   (and (pair? (cdr entry)) (caddr entry)))

#(define (key-entry-measure-position entry)
   "Return the measure position of an entry in @code{localKeySignature}
  or @code {#f} if the entry does not have a measure position.
See @code{key-entry-notename} for details."
   (and (pair? (cdr entry)) (cdddr entry)))
%}

#(define-public (find-pitch-entry keysig pitch accept-global accept-local . oi)
   "Return the first entry in @var{keysig} that matches @var{pitch}
by notename and octave (or only notename if @var{oi} is set to @code{#t}).
Alteration is not considered.
@var{accept-global} states whether key signature entries should be included.
@var{accept-local} states whether local accidentals should be included.
If no matching entry is found, @var{#f} is returned."
   (and (pair? keysig)
(let* ((entry (car keysig))
   (entryoct (key-entry-octave entry))
   (entrynn (key-entry-notename entry))
   (nn (ly:pitch-notename pitch))
   ;; When in doubt, use octave-sensitive form
   (octave-insensitive (if (eq? oi '()) #f oi)))
  (if (and (equal? nn entrynn)
   (or (not entryoct)
   (= entryoct (ly:pitch-octave pitch))
   octave-insensitive)
   (if (key-entry-bar-number entry)
   accept-local
   accept-global))
  entry
  (find-pitch-entry (cdr keysig) pitch accept-global accept-local 
oi)

%%% END COPIED STUFF 

#(define-public (baroque-rule context pitch barnum measurepos)
   "An accidental rule to simulate the practice in 18th century manuscripts and
prints. Don’t remember local accidentals, except with immediate repetitions
(disregarding barlines) and chromatic steps.
Will cease to work properly after time signature changes (if they change 
@var{measureLength})."
   ;; 18th century practice is somewhat inconsistent, so it’s impossible to
   ;; handle all cases in an automated manner.  This is especially true
   ;; for pitches repeated with only one note inbetween.
   ;; But there is no mechanism for that anyway.
   (let* ((keysig (ly:context-property context 'localAlterations))
  (global-entry (find-pitch-entry keysig pitch #t #f))
  (local-entry (find-pitch-entry keysig pitch #f #t #t))

  (ml (ly:context-property context 'measureLength))
  (ml-main (ly:moment-main ml))
  (total-pos (let* ((measurepos-main (ly:moment-main measurepos))
(total-main (+ (* barnum ml-main) measurepos-main))
(measurepos-grace (ly:moment-grace measurepos)))
   (ly:make-moment total-main measurepos-grace)))

  (entrymp (if local-entry (key-entry-measure-position local-entry)))
  (ent

Re: Accidental style in presence of mid-bar line breaks.

2018-06-25 Thread Richard Shann
On Mon, 2018-06-25 at 13:53 +0200, David Kastrup wrote:
> Richard Shann  writes:
> 
> > In 18th c. mss and prints it is quite common to create line breaks
> > during bars - I've found this much improves the legibility of some
> > florid slow movements.
> > 
> > However, it seems that the available accidental styles only take
> > account of barlines and ignore line breaks, which is not very
> > practical, since the brain, seeing a start of line with key
> > signature
> > and a note following without any accidental, will naturally play
> > the
> > note according to the key signature, not holding over any
> > accidental
> > from earlier in the bar on the previous line.
> > 
> > I don't know if this is covered in Gould, but it would be nice if
> > LilyPond could handle this.
> 
> LilyPond's accidental styles are not sufficiently married with the
> line
> breaking decisions to allow for this. 

Ah, I suspected this might be so. I wonder if it would be possible to
alert the user if the \bar "" invitation to create a line break had
been taken up by LilyPond? If LilyPond issued some message then the use
would only need to examine those bars that had actually been broken to
tidy up (with the inevitable danger that the tidying up may cause the
line-breaking to change!).
Is there some hook-point where such a warning could be issued?

Richard


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Accidental style in presence of mid-bar line breaks.

2018-06-25 Thread David Kastrup
Richard Shann  writes:

> In 18th c. mss and prints it is quite common to create line breaks
> during bars - I've found this much improves the legibility of some
> florid slow movements.
>
> However, it seems that the available accidental styles only take
> account of barlines and ignore line breaks, which is not very
> practical, since the brain, seeing a start of line with key signature
> and a note following without any accidental, will naturally play the
> note according to the key signature, not holding over any accidental
> from earlier in the bar on the previous line.
>
> I don't know if this is covered in Gould, but it would be nice if
> LilyPond could handle this.

LilyPond's accidental styles are not sufficiently married with the line
breaking decisions to allow for this.  In fact, LilyPond already has
problems with treating ties over line breaks at barlines: it does repeat
the accidental after the line break in that case but then fails to omit
it for any following occurence of it (there is some issue for that).
The basic accidental style mechanism does not actually include line
breaks: this particular case is already handled as an (incomplete) hack
afterwards.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Accidental style in presence of mid-bar line breaks.

2018-06-25 Thread Richard Shann
In 18th c. mss and prints it is quite common to create line breaks
during bars - I've found this much improves the legibility of some
florid slow movements.

However, it seems that the available accidental styles only take
account of barlines and ignore line breaks, which is not very
practical, since the brain, seeing a start of line with key signature
and a note following without any accidental, will naturally play the
note according to the key signature, not holding over any accidental
from earlier in the bar on the previous line.

I don't know if this is covered in Gould, but it would be nice if
LilyPond could handle this.

Richard



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: 'bach accidental style

2015-12-06 Thread BB

Sorry for noise.

On 06.12.2015 16:48, Simon Albrecht wrote:

On 06.12.2015 16:47, Simon Albrecht wrote:
From studying Bach’s Clavierübung III from a first edition facsimile 
[1] I am well aware of the conventions.
Forgot the footnote: 
<http://imslp.org/wiki/File:PMLP03269-Bach_-_Dritter_Theil_der_Clavier_%C3%9Cbung,_bestehend_in_verschiedenen_Vorspielen_-...-_vor_die_Orgel.pdf>


On 06.12.2015 16:40, BB wrote:

http://www.iment.com/maida/familytree/henry/music/bachnotation.htm

...
In 18th century music-writing, an accidental was not in effect for 
an entire measure but applied only to the note immediately following 
the accidental.


If this were true, we could indeed just use \accidentalStyle forget. 
But there are the two exceptions, which I already described in my 
initial post. Sigh.


This has caused some confusion in many editions. Bach occasionally 
forgot to write the accidentals himself and added them later below 
the notes when there was not room to write them before the notes.


Often it has nothing to do with him ‘forgetting’ the accidentals, but 
with saving space.
But I’m less interested in discussing the notational convention. My 
request was about the technical implementation, in case you didn’t 
notice.


Yours, Simon


...


On 06.12.2015 16:35, Simon Albrecht wrote:

On 06.12.2015 16:28, BB wrote:

May be like this?
%

\version "2.19.32"

\relative {

%\accidentalStyle baroque

\accidentalStyle dodecaphonic

dis'4 cis dis fis

\accidentalStyle default

dis d cis c

dis dis e

} 



My goodness, that was an _example_! No, the whole point of this is 
to _not_ make any changes to the actual music, but having _one_ 
accidental style to do it automatically. Else I’d be using explicit 
accidentals, but that’s tedious and inflexible.


Yours, Simon




On 06.12.2015 16:12, Simon Albrecht wrote:

On 06.12.2015 15:59, BB wrote:

I am not sure what you want to get.


What I want is not one of the accidental styles already 
available, as may be read from the word ‘custom’.

Let me give an example: this
%%
\version "2.19.32"
\relative {
  \accidentalStyle baroque
  dis'4 cis dis fis
  dis d cis c
  dis dis e
}
%%%

should print accidentals on all notes except for the last two. In 
other words, it should behave like forget in the first measure 
(i.e. not remember the dis), and from there on like default (i.e. 
distinguish chromatic pitches, and drop the accidental on 
subsequent notes with identical pitch). (The last note only shows 
that it’s not dodecaphonic what I want.)


Yours, Simon









___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user





___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: 'bach accidental style

2015-12-06 Thread Simon Albrecht

On 06.12.2015 16:47, Simon Albrecht wrote:
From studying Bach’s Clavierübung III from a first edition facsimile 
[1] I am well aware of the conventions.
Forgot the footnote: 
<http://imslp.org/wiki/File:PMLP03269-Bach_-_Dritter_Theil_der_Clavier_%C3%9Cbung,_bestehend_in_verschiedenen_Vorspielen_-...-_vor_die_Orgel.pdf>


On 06.12.2015 16:40, BB wrote:

http://www.iment.com/maida/familytree/henry/music/bachnotation.htm

...
In 18th century music-writing, an accidental was not in effect for an 
entire measure but applied only to the note immediately following the 
accidental.


If this were true, we could indeed just use \accidentalStyle forget. 
But there are the two exceptions, which I already described in my 
initial post. Sigh.


This has caused some confusion in many editions. Bach occasionally 
forgot to write the accidentals himself and added them later below 
the notes when there was not room to write them before the notes.


Often it has nothing to do with him ‘forgetting’ the accidentals, but 
with saving space.
But I’m less interested in discussing the notational convention. My 
request was about the technical implementation, in case you didn’t 
notice.


Yours, Simon


...


On 06.12.2015 16:35, Simon Albrecht wrote:

On 06.12.2015 16:28, BB wrote:

May be like this?
%

\version "2.19.32"

\relative {

%\accidentalStyle baroque

\accidentalStyle dodecaphonic

dis'4 cis dis fis

\accidentalStyle default

dis d cis c

dis dis e

} 



My goodness, that was an _example_! No, the whole point of this is 
to _not_ make any changes to the actual music, but having _one_ 
accidental style to do it automatically. Else I’d be using explicit 
accidentals, but that’s tedious and inflexible.


Yours, Simon




On 06.12.2015 16:12, Simon Albrecht wrote:

On 06.12.2015 15:59, BB wrote:

I am not sure what you want to get.


What I want is not one of the accidental styles already available, 
as may be read from the word ‘custom’.

Let me give an example: this
%%
\version "2.19.32"
\relative {
  \accidentalStyle baroque
  dis'4 cis dis fis
  dis d cis c
  dis dis e
}
%%%

should print accidentals on all notes except for the last two. In 
other words, it should behave like forget in the first measure 
(i.e. not remember the dis), and from there on like default (i.e. 
distinguish chromatic pitches, and drop the accidental on 
subsequent notes with identical pitch). (The last note only shows 
that it’s not dodecaphonic what I want.)


Yours, Simon









___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: 'bach accidental style

2015-12-06 Thread BB



On 06.12.2015 16:40, BB wrote:

http://www.iment.com/maida/familytree/henry/music/bachnotation.htm

...
In 18th century music-writing, an accidental was not in effect for an 
entire measure but applied only to the note immediately following the 
accidental. This has caused some confusion in many editions. Bach 
occasionally forgot to write the accidentals himself and added them 
later below the notes when there was not room to write them before the 
notes.

...


Soem more information about baroque notation from my link archive

http://www.henle.de/blog/en/2014/05/12/best-until-how-long-does-an-accidental-last/ 



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: 'bach accidental style

2015-12-06 Thread Simon Albrecht
From studying Bach’s Clavierübung III from a first edition facsimile 
[1] I am well aware of the conventions.


On 06.12.2015 16:40, BB wrote:

http://www.iment.com/maida/familytree/henry/music/bachnotation.htm

...
In 18th century music-writing, an accidental was not in effect for an 
entire measure but applied only to the note immediately following the 
accidental.


If this were true, we could indeed just use \accidentalStyle forget. But 
there are the two exceptions, which I already described in my initial 
post. Sigh.


This has caused some confusion in many editions. Bach occasionally 
forgot to write the accidentals himself and added them later below the 
notes when there was not room to write them before the notes.


Often it has nothing to do with him ‘forgetting’ the accidentals, but 
with saving space.
But I’m less interested in discussing the notational convention. My 
request was about the technical implementation, in case you didn’t notice.


Yours, Simon


...


On 06.12.2015 16:35, Simon Albrecht wrote:

On 06.12.2015 16:28, BB wrote:

May be like this?
%

\version "2.19.32"

\relative {

%\accidentalStyle baroque

\accidentalStyle dodecaphonic

dis'4 cis dis fis

\accidentalStyle default

dis d cis c

dis dis e

} 



My goodness, that was an _example_! No, the whole point of this is to 
_not_ make any changes to the actual music, but having _one_ 
accidental style to do it automatically. Else I’d be using explicit 
accidentals, but that’s tedious and inflexible.


Yours, Simon




On 06.12.2015 16:12, Simon Albrecht wrote:

On 06.12.2015 15:59, BB wrote:

I am not sure what you want to get.


What I want is not one of the accidental styles already available, 
as may be read from the word ‘custom’.

Let me give an example: this
%%
\version "2.19.32"
\relative {
  \accidentalStyle baroque
  dis'4 cis dis fis
  dis d cis c
  dis dis e
}
%%%

should print accidentals on all notes except for the last two. In 
other words, it should behave like forget in the first measure 
(i.e. not remember the dis), and from there on like default (i.e. 
distinguish chromatic pitches, and drop the accidental on 
subsequent notes with identical pitch). (The last note only shows 
that it’s not dodecaphonic what I want.)


Yours, Simon









___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: 'bach accidental style

2015-12-06 Thread BB

http://www.iment.com/maida/familytree/henry/music/bachnotation.htm

...
In 18th century music-writing, an accidental was not in effect for an 
entire measure but applied only to the note immediately following the 
accidental. This has caused some confusion in many editions. Bach 
occasionally forgot to write the accidentals himself and added them 
later below the notes when there was not room to write them before the 
notes.

...


On 06.12.2015 16:35, Simon Albrecht wrote:

On 06.12.2015 16:28, BB wrote:

May be like this?
%

\version "2.19.32"

\relative {

%\accidentalStyle baroque

\accidentalStyle dodecaphonic

dis'4 cis dis fis

\accidentalStyle default

dis d cis c

dis dis e

} 



My goodness, that was an _example_! No, the whole point of this is to 
_not_ make any changes to the actual music, but having _one_ 
accidental style to do it automatically. Else I’d be using explicit 
accidentals, but that’s tedious and inflexible.


Yours, Simon




On 06.12.2015 16:12, Simon Albrecht wrote:

On 06.12.2015 15:59, BB wrote:

I am not sure what you want to get.


What I want is not one of the accidental styles already available, 
as may be read from the word ‘custom’.

Let me give an example: this
%%
\version "2.19.32"
\relative {
  \accidentalStyle baroque
  dis'4 cis dis fis
  dis d cis c
  dis dis e
}
%%%

should print accidentals on all notes except for the last two. In 
other words, it should behave like forget in the first measure (i.e. 
not remember the dis), and from there on like default (i.e. 
distinguish chromatic pitches, and drop the accidental on subsequent 
notes with identical pitch). (The last note only shows that it’s not 
dodecaphonic what I want.)


Yours, Simon







___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: 'bach accidental style

2015-12-06 Thread Simon Albrecht

On 06.12.2015 16:28, BB wrote:

May be like this?
%

\version "2.19.32"

\relative {

%\accidentalStyle baroque

\accidentalStyle dodecaphonic

dis'4 cis dis fis

\accidentalStyle default

dis d cis c

dis dis e

} 



My goodness, that was an _example_! No, the whole point of this is to 
_not_ make any changes to the actual music, but having _one_ accidental 
style to do it automatically. Else I’d be using explicit accidentals, 
but that’s tedious and inflexible.


Yours, Simon




On 06.12.2015 16:12, Simon Albrecht wrote:

On 06.12.2015 15:59, BB wrote:

I am not sure what you want to get.


What I want is not one of the accidental styles already available, as 
may be read from the word ‘custom’.

Let me give an example: this
%%
\version "2.19.32"
\relative {
  \accidentalStyle baroque
  dis'4 cis dis fis
  dis d cis c
  dis dis e
}
%%%

should print accidentals on all notes except for the last two. In 
other words, it should behave like forget in the first measure (i.e. 
not remember the dis), and from there on like default (i.e. 
distinguish chromatic pitches, and drop the accidental on subsequent 
notes with identical pitch). (The last note only shows that it’s not 
dodecaphonic what I want.)


Yours, Simon





___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: 'bach accidental style

2015-12-06 Thread BB

May be like this?
%

\version "2.19.32"

\relative {

%\accidentalStyle baroque

\accidentalStyle dodecaphonic

dis'4 cis dis fis

\accidentalStyle default

dis d cis c

dis dis e

} 



On 06.12.2015 16:12, Simon Albrecht wrote:

On 06.12.2015 15:59, BB wrote:

I am not sure what you want to get.


What I want is not one of the accidental styles already available, as 
may be read from the word ‘custom’.

Let me give an example: this
%%
\version "2.19.32"
\relative {
  \accidentalStyle baroque
  dis'4 cis dis fis
  dis d cis c
  dis dis e
}
%%%

should print accidentals on all notes except for the last two. In 
other words, it should behave like forget in the first measure (i.e. 
not remember the dis), and from there on like default (i.e. 
distinguish chromatic pitches, and drop the accidental on subsequent 
notes with identical pitch). (The last note only shows that it’s not 
dodecaphonic what I want.)


Yours, Simon


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: 'bach accidental style

2015-12-06 Thread Simon Albrecht

On 06.12.2015 15:31, Simon Albrecht wrote:

Hello,

I would like to have a custom accidental style acting like manuscripts 
and first editions of Seb. Bach do:
and, in fact, was common at the time. I think the assumption of our docs 
that the default style were corresponding to 18th century usage rather 
refers to 19th/20th century editions of 18th century music.

– do not remember accidentals*
– unless a pitch is immediately repeated
– or with chromatic steps: an accidental should always be printed if 
the previous note has the same pitch, but a different alteration.

To be more precise: the same _step_, but a different alteration.
I find the mechanism for defining accidental styles difficult (see 
<http://lists.gnu.org/archive/html/lilypond-user/2014-02/msg00250.html>); 
can anyone help with this? It might be a modification of 'forget.


Yours, Simon

* except of course those in the key signature

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: 'bach accidental style

2015-12-06 Thread Simon Albrecht

On 06.12.2015 15:59, BB wrote:

I am not sure what you want to get.


What I want is not one of the accidental styles already available, as 
may be read from the word ‘custom’.

Let me give an example: this
%%
\version "2.19.32"
\relative {
  \accidentalStyle baroque
  dis'4 cis dis fis
  dis d cis c
  dis dis e
}
%%%

should print accidentals on all notes except for the last two. In other 
words, it should behave like forget in the first measure (i.e. not 
remember the dis), and from there on like default (i.e. distinguish 
chromatic pitches, and drop the accidental on subsequent notes with 
identical pitch). (The last note only shows that it’s not dodecaphonic 
what I want.)


Yours, Simon

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: 'bach accidental style

2015-12-06 Thread BB



On 06.12.2015 15:59, BB wrote:
I am not sure what you want to get. For a modern piece of music I have 
tried some different styles of accidentials that LP provides. In this 
example I used a part of Satie theme (as far as I remember?).


Sorry, there is an error in the first line of my example code, may cause 
trouble:


\\version "2.16.2"


Must read
\version ...




___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: 'bach accidental style

2015-12-06 Thread BB
I am not sure what you want to get. For a modern piece of music I have 
tried some different styles of accidentials that LP provides. In this 
example I used a part of Satie theme (as far as I remember?).


%%%

\\version "2.16.2"

Noten = {

\relative c' {

\time 2/4

{

ais4 cis |

ges4 dis'4|

{gis,8 d'} c dis |

}

}

}

\new Staff {

\tempo "default"

%# (set-accidental-style 'default)

\accidentalStyle default

\Noten

}

\new Staff {

\tempo "modern"

%# (set-accidental-style 'modern)

\accidentalStyle modern

\Noten

}

\new Staff {

\tempo "dodecaphonic"

%# (set-accidental-style 'dodecaphonic)

\accidentalStyle dodecaphonic

\Noten

}

\new Staff {

\tempo "teaching"

%# (set-accidental-style 'teaching)

\accidentalStyle teaching

\Noten

}

%%%






On 06.12.2015 15:31, Simon Albrecht wrote:

Hello,

I would like to have a custom accidental style acting like manuscripts 
and first editions of Seb. Bach do:

– do not remember accidentals*
– unless a pitch is immediately repeated
– or with chromatic steps: an accidental should always be printed if 
the previous note has the same pitch, but a different alteration.
I find the mechanism for defining accidental styles difficult (see 
<http://lists.gnu.org/archive/html/lilypond-user/2014-02/msg00250.html>); 
can anyone help with this? It might be a modification of 'forget.


Yours, Simon

* except of course those in the key signature

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


'bach accidental style

2015-12-06 Thread Simon Albrecht

Hello,

I would like to have a custom accidental style acting like manuscripts 
and first editions of Seb. Bach do:

– do not remember accidentals*
– unless a pitch is immediately repeated
– or with chromatic steps: an accidental should always be printed if the 
previous note has the same pitch, but a different alteration.
I find the mechanism for defining accidental styles difficult (see 
<http://lists.gnu.org/archive/html/lilypond-user/2014-02/msg00250.html>); can 
anyone help with this? It might be a modification of 'forget.


Yours, Simon

* except of course those in the key signature

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Custom accidental style (for cadenza)?

2014-06-17 Thread David Nalesnik
Hi,


On Mon, Jun 16, 2014 at 8:33 PM, James Harkins  wrote:

> On Tuesday, June 17, 2014 8:21:10 AM HKT, David Nalesnik wrote:
>
>> Here's a variation which incorporates my little discovery :)
>
>
Oops--there's an error.  In the function "unnecessary-acc?," it should be
((forced? me) #f)


>
> Thanks again -- I owe you a beer, or some snippets of SuperCollider code,
> or something. (This exchange, incidentally, is one of the reasons why I
> prefer free-as-in-freedom software whenever possible.)
>

I'm glad to help!

Best,
David
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Custom accidental style (for cadenza)?

2014-06-16 Thread James Harkins

On Tuesday, June 17, 2014 8:21:10 AM HKT, David Nalesnik wrote:

Here's a variation which incorporates my little discovery :)


This is great! Thanks! I can safely say, it probably would have taken me 
half a year to figure this out on my own...



In the second example, the ! forces the natural.  I don't see that there's
any logic in allowing the function to ignore an explicit directive like
this.  (Though I'm guessing it's there as an artifact from the "this is how
I'd like it to look" example?)


The ! is there in my second example to illustrate the transposing behavior 
that I didn't want. If I remove it from your test file, then it does just 
what I wanted: the C# displays once per beamed group, and there is no 
unnecessary natural sign for E-nat. in the transposed part.


Thanks again -- I owe you a beer, or some snippets of SuperCollider code, 
or something. (This exchange, incidentally, is one of the reasons why I 
prefer free-as-in-freedom software whenever possible.)


hjh


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Custom accidental style (for cadenza)?

2014-06-16 Thread David Nalesnik
On Mon, Jun 16, 2014 at 7:09 PM, David Nalesnik 
wrote:

> Hi,
>
>
> On Mon, Jun 16, 2014 at 6:00 PM, David Nalesnik 
> wrote:
>
> Issues:
>> --You can't force an accidental with "!".   Perhaps a property
>> 'force-accidental might be created?
>>
>
> Of course, there's 'forced...
>
>
Here's a variation which incorporates my little discovery :)

In the second example, the ! forces the natural.  I don't see that there's
any logic in allowing the function to ignore an explicit directive like
this.  (Though I'm guessing it's there as an artifact from the "this is how
I'd like it to look" example?)

--David
\version "2.19.5"

\language "english"

#(define (get-pitch grob)
   (ly:event-property (ly:grob-property grob 'cause) 'pitch))

#(define (has-accidental? grob)
   (ly:grob? (ly:grob-object grob 'accidental-grob)))

#(define (first-in-beamed-group? me heads)
   (let loop ((x heads))
 (cond
  ((eq? (car x) me) #t)
  ((equal? (get-pitch (car x)) (get-pitch me)) #f)
  (else (loop (cdr x))

#(define (preceded-by-chromatic-variant? me heads)
   ;; Within a beamed group, compare a pitch with the preceding pitches.  Find the closest
   ;; pitch sharing octave and note-name with our pitch.  If it has a different alteration
   ;; from our pitch, return #t.  Our pitch will then need an accidental.
   (let* ((me-pitch (get-pitch me))
  (preceding
   (take-while
(lambda (x) (not (eq? x me)))
heads))
  (preceding
   (map
(lambda (x) (get-pitch x))
preceding))
  (preceding
   (filter
(lambda (x)
  (and (equal? (ly:pitch-octave x) (ly:pitch-octave me-pitch))
   (equal? (ly:pitch-notename x) (ly:pitch-notename me-pitch
preceding)))
 
 (and (pair? preceding)
  (not (equal? (ly:pitch-alteration (last preceding))
   (ly:pitch-alteration me-pitch))

#(define (redundant-natural? me heads)
   ;; Will remove any natural which isn't cancelling anything within a beamed group.
   (let* ((acc (ly:grob-object me 'accidental-grob))
  (glyph-name (ly:grob-property acc 'glyph-name)))
 (and (string=? glyph-name "accidentals.natural")
  (not (preceded-by-chromatic-variant? me heads))
  (not (forced? me)

#(define (forced? grob)
   (and (has-accidental? grob)
 (eq? #t (ly:grob-property (ly:grob-object grob 'accidental-grob) 'forced

#(define (unnecessary-acc? me heads)
   (cond
((redundant-natural? me heads) #t)
((first-in-beamed-group? me heads) #f)
((preceded-by-chromatic-variant? me heads) #f)
((forced? me))
(else #t)))

#(define (accidentals-by-beam-group grob)
   (let* ((stems (ly:grob-array->list (ly:grob-object grob 'stems)))
  (heads (map (lambda (x)
(ly:grob-array->list
 (ly:grob-object x 'note-heads))) stems))
  (heads (flatten-list heads)))
 
 (let loop ((candidates heads))
   (if (pair? candidates)
   (begin
(if (and
 (has-accidental? (car candidates))
 (unnecessary-acc? (car candidates) heads))
(ly:grob-suicide! (ly:grob-object (car candidates) 'accidental-grob)))
(loop (cdr candidates)))

\score {
  \new Staff {
\accidentalStyle dodecaphonic
\override Beam.before-line-breaking = #accidentals-by-beam-group 
\time 2/4
\relative c'' { e8 [ cs ] \tuplet 5/4 { e16 [ cs! e cs e ] } }
\bar "||"
\transpose a c' \relative c'' { e8 [ cs ] \tuplet 5/4 { e16 [ cs e cs e ] } }
  }
}


notesA = \relative c'' { e8 [ cs ] \tuplet 5/4 { e16 [ cs! e cs e ] } }

\score {
  \new Staff \relative c'' {
\time 2/4
\accidentalStyle dodecaphonic
\override Beam.before-line-breaking = #accidentals-by-beam-group
\notesA
\bar "||"
\transpose a c' \notesA
  }
}

\score {
  \new Staff {
\relative c' {
  \accidentalStyle dodecaphonic
  \override Beam.before-line-breaking = #accidentals-by-beam-group
  cs8 cs cs cs cs cs cs cs
  cs ds ds cs cs ds ds cs
q   q  
q 
  cs4 cs cs cs
}
  }
}
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Custom accidental style (for cadenza)?

2014-06-16 Thread David Nalesnik
Hi,


On Mon, Jun 16, 2014 at 6:00 PM, David Nalesnik 
wrote:

Issues:
> --You can't force an accidental with "!".   Perhaps a property
> 'force-accidental might be created?
>

Of course, there's 'forced...
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Custom accidental style (for cadenza)?

2014-06-16 Thread David Nalesnik
Hi James,


On Mon, Jun 16, 2014 at 2:06 AM, James Harkins  wrote:

> TL;DR version of the question: How could I define an accidental style that
> behaves mostly like neo-modern, but also avoids repeating accidentals
> within a beamed group?
>
> [...]

>
> A nice middle ground between "remember accidentals for the whole cadenza"
> and "remember accidentals only from the immediately preceding note" would
> be to remember accidentals within a beamed group. Is there any way to hack
> this up in scheme, say?
>
> Thanks,
> hjh
>
>
I don't know if this will give you what you want with the Frescobaldi
cadenza, but maybe it's helpful...

The attached should do accidentals purely by beamed group.  For it to work
properly, you need to set accidental-style to dodecaphonic.

Issues:
--You can't force an accidental with "!".   Perhaps a property
'force-accidental might be created?
--You'll get repeated accidentals with immediate repetition and no beams
(i.e., a succession of quarter notes).  Strict application of
accidentals-by-beamed-group...

Hope you find a use for this!

--David
\version "2.19.5"

\language "english"

#(define (get-pitch grob)
   (ly:event-property (ly:grob-property grob 'cause) 'pitch))

#(define (has-accidental? grob)
   (ly:grob? (ly:grob-object grob 'accidental-grob)))

#(define (first-in-beamed-group? me heads)
   (let loop ((x heads))
 (cond
  ((eq? (car x) me) #t)
  ((equal? (get-pitch (car x)) (get-pitch me)) #f)
  (else (loop (cdr x))

#(define (preceded-by-chromatic-variant? me heads)
   ;; Within a beamed group, compare a pitch with the preceding pitches.  Find the closest
   ;; pitch sharing octave and note-name with our pitch.  If it has a different alteration
   ;; from our pitch, return #t.  Our pitch will then need an accidental.
   (let* ((me-pitch (get-pitch me))
  (preceding
   (take-while
(lambda (x) (not (eq? x me)))
heads))
  (preceding
   (map
(lambda (x) (get-pitch x))
preceding))
  (preceding
   (filter
(lambda (x)
  (and (equal? (ly:pitch-octave x) (ly:pitch-octave me-pitch))
   (equal? (ly:pitch-notename x) (ly:pitch-notename me-pitch
preceding)))
 
 (and (pair? preceding)
  (not (equal? (ly:pitch-alteration (last preceding))
   (ly:pitch-alteration me-pitch))

#(define (redundant-natural? me heads)
   ;; Will remove any natural which isn't cancelling anything within a beamed group.
   (let* ((acc (ly:grob-object me 'accidental-grob))
  (glyph-name (ly:grob-property acc 'glyph-name)))
 (and (string=? glyph-name "accidentals.natural")
  (not (preceded-by-chromatic-variant? me heads)

#(define (unnecessary-acc? me heads)
   (cond
((redundant-natural? me heads) #t)
((first-in-beamed-group? me heads) #f)
((preceded-by-chromatic-variant? me heads) #f)
(else #t)))

#(define (accidentals-by-beam-group grob)
   (let* ((stems (ly:grob-array->list (ly:grob-object grob 'stems)))
  (heads (map (lambda (x)
(ly:grob-array->list
 (ly:grob-object x 'note-heads))) stems))
  (heads (flatten-list heads)))
 
 (let loop ((candidates heads))
   (if (pair? candidates)
   (begin
(if (and
 (has-accidental? (car candidates))
 (unnecessary-acc? (car candidates) heads))
(ly:grob-suicide! (ly:grob-object (car candidates) 'accidental-grob)))
(loop (cdr candidates)))

\score {
  \new Staff {
\accidentalStyle dodecaphonic
\override Beam.before-line-breaking = #accidentals-by-beam-group 
\time 2/4
\relative c'' { e8 [ cs ] \tuplet 5/4 { e16 [ cs! e cs e ] } }
\bar "||"
\transpose a c' \relative c'' { e8 [ cs ] \tuplet 5/4 { e16 [ cs e cs e ] } }
  }
}


notesA = \relative c'' { e8 [ cs ] \tuplet 5/4 { e16 [ cs! e cs e ] } }

\score {
  \new Staff \relative c'' {
\time 2/4
\accidentalStyle dodecaphonic
\override Beam.before-line-breaking = #accidentals-by-beam-group
\notesA
\bar "||"
\transpose a c' \notesA
  }
}

\score {
  \new Staff {
\relative c' {
  \accidentalStyle dodecaphonic
  \override Beam.before-line-breaking = #accidentals-by-beam-group
  cs8 cs cs cs cs cs cs cs
  cs ds ds cs cs ds ds cs
q   q  
q 
  cs4 cs cs cs
}
  }
}
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Custom accidental style (for cadenza)?

2014-06-16 Thread James Harkins
TL;DR version of the question: How could I define an accidental style that 
behaves mostly like neo-modern, but also avoids repeating accidentals 
within a beamed group?


Full explanation why --

I have a cadenza which, according to Frescobaldi's duration counter, spans 
59 quarter notes. It's in a free-chromatic style, so accidentals are very 
important. Because it's in \cadenzaOn ... \cadenzaOff, accidentals are 
remembered and not repeated basically "forever" within this stretch of 
time.


If it were a C instrument, it would be easy: I would sprinkle "!" 
throughout, wherever I want to see the accidental but it isn't printed by 
default. But it's actually for clarinet in A... so I write the music 
variable in concert pitch, and then use \transpose a c' in the layout file 
for the part. Then, some of the accidentals that had to be forced for the 
score in C end up forcing a natural-sign in the part, which looks dumb.


It turns out that most of the cadenza looks okay if I use neo-modern 
accidental style, *but* there's one exception: fast notes that alternate 
between two pitches. See the example pasted below:


#1 is the appearance I want (first bar is concert pitch, second bar is 
transposed).


#2 illustrates the problem I described above. Forcing the second "cs!" 
causes a confusing natural sign to be printed.


#3 The default accidental style "works," but doesn't scale up nicely to a 
59-beat cadenza (because it will hide an accidental that appeared ten whole 
notes ago).


#4 Neo-modern is "acceptable," the third sharp is really terribly fussy.

A nice middle ground between "remember accidentals for the whole cadenza" 
and "remember accidentals only from the immediately preceding note" would 
be to remember accidentals within a beamed group. Is there any way to hack 
this up in scheme, say?


Thanks,
hjh

~~ EXAMPLE

\version "2.18.2"
\language "english"

\markup "What I'd like"

\score {
 \new Staff {
   \time 2/4
   \relative c'' { e8 [ cs ] \tuplet 5/4 { e16 [ cs! e cs e ] } }
   \bar "||"
   \transpose a c' \relative c'' { e8 [ cs ] \tuplet 5/4 { e16 [ cs e cs e 
] } }

 }
}

\markup \column {
 \vspace #2
 "What I get by using 'transpose' with a music variable: Superfluous 
natural-sign"

}

notesA = \relative c'' { e8 [ cs ] \tuplet 5/4 { e16 [ cs! e cs e ] } }

\score {
 \new Staff \relative c'' {
   \time 2/4
   \notesA
   \bar "||"
   \transpose a c' \notesA
 }
}

\markup \column {
 \vspace #2
 \wordwrap-string #"Default, no big deal here but in a longer cadenza, 
need to force too many accidentals"

}

notesB = \relative c'' { e8 [ cs ] \tuplet 5/4 { e16 [ cs e cs e ] } }

\score {
 \new Staff {
   \accidentalStyle Staff.default
   \time 2/4
   \notesB
   \bar "||"
   \transpose a c' \notesB
 }
}

\markup \column { \vspace #2 "Neo-modern: The last sharp looks a bit silly" 
}


\score {
 \new Staff {
   \accidentalStyle Staff.neo-modern
   \time 2/4
   \notesB
   \bar "||"
   \transpose a c' \notesB
 }
}


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Extra naturals in accidental-style teaching?

2014-04-06 Thread Paul Morris
Ariel Barton wrote
> I think that what I want is not the forget style, but to have Lilypond
> typeset everything in C major/A minor. I'd still sort of like to print
> the true key signature; do you know if there's a way to print the D major
> keysignature while it's in C? 

See the following which does what you describe.  The \omit line inserts but
does not display a grace note between the two key signatures, and the
\override line prevents the key cancellation from being shown.  

\version "2.18.0"

\relative f' {
  \key g \major
  \omit \grace s8
  \override Staff.KeyCancellation.stencil = ##f
  \key c \major
  c8 cis d dis e f fis g gis a ais b c
}

One problem is that if you want the g key signature to be shown at the
beginning of each line, as is customary, then you would need to do something
like this at the beginning of each line (ugh).  So it's not really a good
solution.  Another possibility might be to replace the c major stencil, but
that will not really be any better I don't think...

-Paul



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Extra-naturals-in-accidental-style-teaching-tp161142p161319.html
Sent from the User mailing list archive at Nabble.com.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Extra naturals in accidental-style teaching?

2014-04-06 Thread Ariel Barton
Thank you!

I think that what I want is not the forget style, but to have Lilypond
typeset everything in C major/A minor. I'd still sort of like to print
the true key signature; do you know if there's a way to print the D major
keysignature while it's in C? (\key d \major \key c \major produces an
error message unless I put something between the two key changes, \key d
\major s1 \key c \major makes my measure count off and also prints a
bunch of courtesy accidentals at the "key change" to C major; there
might be something I can do involving the "sharp=postitions" setting for
the "key-signature-interface" but I can't really figure out how Lilypond
wants me to phrase that.)

Thanks,
Ariel

Paul Morris wrote

> Hi Ariel,  It seems that these cautionary natural signs appear any time a
> given note occurs again, if it is not immediately following the same
note.
>
> \version "2.18.2"
> \new Staff {
>   \accidentalStyle teaching
>   \key c \major
>   \relative f' {
>   c8 d c d e e f e f e e d c c d e
>   }
> }
>
> This may be a bug. The docs say "cautionary accidentals are added for all
> sharp or flat tones specified by the key signature, except if the note is
> immediately repeated."[1]  So I think these cautionary _natural_ signs
> shouldn't be shown at all?
>
> [1]
>
http://lilypond.org/doc/v2.18/Documentation/notation/displaying-pitches#automatic-accidentals
>
> As a work-around you would have to manually hide each of these unwanted
> accidentals, but it would probably be easier at that point to use "modern"
> style and manually force the natural signs to appear, by adding a ! after
> the note like this: c!  Or maybe a different style (like forget ?) would
be
> close enough to what you want?
>
> HTH,
> -Paul
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Extra naturals in accidental-style teaching?

2014-04-03 Thread Keith OHara
Paul Morris  paulwmorris.com> writes:

> Ariel Barton wrote
> > I am trying to use the accidental style "teaching" to make my music a
> > little easier to use. The problem is, "teaching" produces a whole lot of
> > superfluous natural signs that aren't really helpful; they just clutter up
> > the page. (They don't seem to follow any particular rules, either; they
> > seem to be distributed at random.) 
> 

> This may be a bug. 

Yes. Version 2.14 of LilyPond printed reminders for only sharps and flats.
I put <https://code.google.com/p/lilypond/issues/detail?id=3894>
on the bug list.  
This is something that can be fixed without recompiling LilyPond, so any
one of a number of people here might follow that link to the change in code
that changed behavior, figure out what was intended, and a way to do
it with the desired output.



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Extra naturals in accidental-style teaching?

2014-04-03 Thread Paul Morris
Ariel Barton wrote
> I am trying to use the accidental style "teaching" to make my music a
> little easier to use. The problem is, "teaching" produces a whole lot of
> superfluous natural signs that aren't really helpful; they just clutter up
> the page. (They don't seem to follow any particular rules, either; they
> seem to be distributed at random.) 

Hi Ariel,  It seems that these cautionary natural signs appear any time a
given note occurs again, if it is not immediately following the same note.  

\version "2.18.2"
\new Staff {
  \accidentalStyle teaching
  \key c \major
  \relative f' {
  c8 d c d e e f e f e e d c c d e
  }
}

This may be a bug. The docs say "cautionary accidentals are added for all
sharp or flat tones specified by the key signature, except if the note is
immediately repeated."[1]  So I think these cautionary _natural_ signs
shouldn't be shown at all?

[1]
http://lilypond.org/doc/v2.18/Documentation/notation/displaying-pitches#automatic-accidentals

As a work-around you would have to manually hide each of these unwanted
accidentals, but it would probably be easier at that point to use "modern"
style and manually force the natural signs to appear, by adding a ! after
the note like this: c!  Or maybe a different style (like forget ?) would be
close enough to what you want?

HTH,
-Paul



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Extra-naturals-in-accidental-style-teaching-tp161142p161165.html
Sent from the User mailing list archive at Nabble.com.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Extra naturals in accidental-style teaching?

2014-04-03 Thread Ariel Barton
Hello,

I am trying to use the accidental style "teaching" to make my music a
little easier to use. The problem is, "teaching" produces a whole lot of
superfluous natural signs that aren't really helpful; they just clutter up
the page. (They don't seem to follow any particular rules, either; they
seem to be distributed at random.) Can you tell me how to get rid of them
(while keeping the courtesy sharps and flats)?

Thank you,
Ariel Barton

(Here is an example: note that the first song is in C major with no
accidentals and I still have a lot of random natural signs.)

\version "2.18.2"
\language "english"
\layout {
\context {
\Staff
#(set-accidental-style 'teaching)
 }
}
\relative c'{
\key c \major \time 2/4
e8 g g g | g a g f | e g g g | g a g f | e g d f | e g d f |
e4 d | c2 |
}
\relative c' {
\key e \minor \partial 4
b4 | g' g fs fs | g8 g4. e2 | b4 b4 ds8 ds4.   | e2. b4 |
g' g fs fs | g8 g4. e2 | b4 b4 ds8 ds4.| e1 |
e8 e4.~ e2 | a4 a2.| b4. (as8) b4. as8 | b4 b8(a?) g
(e4.) |
g4 e2 (g4) | e8(d) b2. | b4 b4 ds8 ds4.| e2.
}
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: "dodecaphonic-first" accidental style

2014-03-25 Thread Urs Liska

Am 24.03.2014 17:52, schrieb Urs Liska:

I've just compiled a custom LilyPond with that patch in it and will soon
upload it for review. Although dodecaphonic-no-repeat is what _I_ had
asked for I do think this also makes sense.


https://codereview.appspot.com/79680044/

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: "dodecaphonic-first" accidental style

2014-03-24 Thread Simon Albrecht


Am 24.03.2014 15:45, schrieb Rutger Hofman:


Right, so there is a new style dodecaphonic-no-repeat from 2.19.3 
onwards. But it does something else than the style dodecaphonic-first 
that I wrote about, long ago. dodecaphonic-no-repeat suppresses 
accidentals for immediately repeated notes. dodecaphonic-first 
suppresses accidentals for any notes that already occurred earlier in 
the bar. My opinion is that there is still good use for 
dodecaphonic-first; the main reason is that wiping out undesired 
accidentals leaves visible traces because it consumes horizontal space.
This I find very interesting: even if the accidental’s stencil is turned 
off, it still takes up horizontal space. Seems like a bug, doesn’t it?


Greetings, Simon


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: "dodecaphonic-first" accidental style

2014-03-24 Thread Gilberto Agostinho
Urs Liska wrote
> Did you know (as Daniel Spreadbury pointed out) that you *can't* preset 
> accidental behaviour in the "two most mature commercial products"???

Oh I do, and how well I do... as an ex-Sibelius user, it was a pain to check
the accidentals on my compositions. There was an option on Sib 6 that
allowed you to add accidentals to all notes, but that was it! Then I had to
check manually the whole score for repeated notes... and did I mention that
when you change something such as a single accidental in a note, the layout
of the bar is potentially lost and reset to the default (e.g., distance
between two notes)?! Painful days back then :)






--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/dodecaphonic-first-accidental-style-tp141907p160784.html
Sent from the User mailing list archive at Nabble.com.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: "dodecaphonic-first" accidental style

2014-03-24 Thread Urs Liska

Am 24.03.2014 17:48, schrieb Gilberto Agostinho:

Hi Rutget,


Rutger Hofman-2 wrote

Right, so there is a new style dodecaphonic-no-repeat from 2.19.3
onwards. But it does something else than the style dodecaphonic-first
that I wrote about, long ago. dodecaphonic-no-repeat suppresses
accidentals for immediately repeated notes. dodecaphonic-first
suppresses accidentals for any notes that already occurred earlier in
the bar.


Thanks for clarifying that. For the types of compositions I write,
dodecaphonic-no-repeat is the solution I always needed.


Rutger Hofman-2 wrote

I renewed the patch for versions from 2.19.3 upwards. It is attached
(pre-2.19.3 and 2.19.3 onwards; it used to be a reverse-patch, no longer
now). It is extremely small. I also keep it in my github repo for
lilypond additions, in the patches/ dir:
https://github.com/rfhh/lily-contribs


That's great, thanks for sharing it here!


I've just compiled a custom LilyPond with that patch in it and will soon 
upload it for review. Although dodecaphonic-no-repeat is what _I_ had 
asked for I do think this also makes sense.


Did you know (as Daniel Spreadbury pointed out) that you *can't* preset 
accidental behaviour in the "two most mature commercial products"???




Thanks again. Regards,
Gilberto



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/dodecaphonic-first-accidental-style-tp141907p160778.html
Sent from the User mailing list archive at Nabble.com.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user




___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: "dodecaphonic-first" accidental style

2014-03-24 Thread Gilberto Agostinho
Hi Rutget,


Rutger Hofman-2 wrote
> Right, so there is a new style dodecaphonic-no-repeat from 2.19.3 
> onwards. But it does something else than the style dodecaphonic-first 
> that I wrote about, long ago. dodecaphonic-no-repeat suppresses 
> accidentals for immediately repeated notes. dodecaphonic-first 
> suppresses accidentals for any notes that already occurred earlier in 
> the bar.

Thanks for clarifying that. For the types of compositions I write,
dodecaphonic-no-repeat is the solution I always needed.


Rutger Hofman-2 wrote
> I renewed the patch for versions from 2.19.3 upwards. It is attached 
> (pre-2.19.3 and 2.19.3 onwards; it used to be a reverse-patch, no longer 
> now). It is extremely small. I also keep it in my github repo for 
> lilypond additions, in the patches/ dir:
> https://github.com/rfhh/lily-contribs

That's great, thanks for sharing it here! 

Thanks again. Regards,
Gilberto



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/dodecaphonic-first-accidental-style-tp141907p160778.html
Sent from the User mailing list archive at Nabble.com.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: "dodecaphonic-first" accidental style

2014-03-24 Thread Rutger Hofman

On 03/24/2014 01:50 PM, Gilberto Agostinho wrote:> Gilberto Agostinho wrote

The correct syntax is with the "s" [...]


I meant without without the "s", as in "repeat" and NOT "repeats"
Rutger Hofman-2 wrote

[...]
As a fix, I made a small addition to music-functions.scm to add a
dodecaphonic-first accidental style. Patch against 2.17.18-1 attached.
[...]
Using dodecaphonic-first and adding ! here and there works fine for me.


I already apologize for replying to an old post (almost 1 year old!), but I
am really interested in this dodecaphonic-first accidental style. The
problem is I do not know how to deal with this .patch file!


Right, so there is a new style dodecaphonic-no-repeat from 2.19.3 
onwards. But it does something else than the style dodecaphonic-first 
that I wrote about, long ago. dodecaphonic-no-repeat suppresses 
accidentals for immediately repeated notes. dodecaphonic-first 
suppresses accidentals for any notes that already occurred earlier in 
the bar. My opinion is that there is still good use for 
dodecaphonic-first; the main reason is that wiping out undesired 
accidentals leaves visible traces because it consumes horizontal space, 
whereas adding occasional forced accidentals works fully as desired.


I would love it if the dodecaphonic-first style can be patched into 
lilypond; not only for the Greater Good, but also to relieve me from 
applying it to each and every lilypond release, and maintaining it 
across changes...


I renewed the patch for versions from 2.19.3 upwards. It is attached 
(pre-2.19.3 and 2.19.3 onwards; it used to be a reverse-patch, no longer 
now). It is extremely small. I also keep it in my github repo for 
lilypond additions, in the patches/ dir:


https://github.com/rfhh/lily-contribs

That repo currently also contains my converter from NIFF to lilypond 
(and the NIFF sdk, with 64-bit patch), and an upgraded version of 
Han-Wen's pmx2ly converter that I used to prepare an edition of Bach's 
BWV 146/1052a (on IMSLP).


Rutger






--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/dodecaphonic-first-accidental-style-tp141907p160773.html
Sent from the User mailing list archive at Nabble.com.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user



--- music-functions.scm.orig	2013-10-06 19:05:19.0 +0200
+++ music-functions.scm	2013-10-24 21:13:35.305128903 +0200
@@ -1328,14 +1328,16 @@
  (car alteration-def))
 (else 0)))
 
-(define (check-pitch-against-signature context pitch barnum laziness octaveness)
+(define (check-pitch-against-signature context pitch barnum laziness octaveness all-naturals)
   "Checks the need for an accidental and a @q{restore} accidental against
 @code{localKeySignature}.  The @var{laziness} is the number of measures
 for which reminder accidentals are used (i.e., if @var{laziness} is zero,
 only cancel accidentals in the same measure; if @var{laziness} is three,
 we cancel accidentals up to three measures after they first appear.
 @var{octaveness} is either @code{'same-octave} or @code{'any-octave} and
-specifies whether accidentals should be canceled in different octaves."
+specifies whether accidentals should be canceled in different octaves.
+If @var{all-naturals} is ##t, notes that do not occur in @code{keySignature}
+also get an accidental."
   (let* ((ignore-octave (cond ((equal? octaveness 'any-octave) #t)
   ((equal? octaveness 'same-octave) #f)
   (else
@@ -1393,7 +1395,7 @@
 (let* ((prev-alt (extract-alteration previous-alteration))
(this-alt (ly:pitch-alteration pitch)))
 
-  (if (not (= this-alt prev-alt))
+  (if (or (and all-naturals (eq? #f previous-alteration)) (not (= this-alt prev-alt)))
   (begin
 (set! need-accidental #t)
 (if (and (not (= this-alt 0))
@@ -1420,7 +1422,13 @@
 accidental lasts over that many bar lines.  @w{@code{-1}} is `forget
 immediately', that is, only look at key signature.  @code{#t} is `forever'."
 
-  (check-pitch-against-signature context pitch barnum laziness octaveness))
+  (check-pitch-against-signature context pitch barnum laziness octaveness #f))
+
+(define-public ((make-accidental-dodecaphonic-rule octaveness laziness) context pitch barnum measurepos)
+  "Variation on function make-accidental-rule that creates an dodecaphonic
+accidental rule."
+
+  (check-pitch-against-signature context pitch barnum laziness octaveness #t))
 
 (define (key-entry-notename entry)
   "Return the pitch of an @var{entry} in @code{localKeySignature}.
@@ -1610,6 +1618,14 @@
   `(Staff ,(lambda (c p bn mp) '(#f . #t)))
   '()
  

Re: "dodecaphonic-first" accidental style

2014-03-24 Thread Urs Liska
But of course it's easy not to notice that addition.

Phil Holmes  schrieb am 24.03.2014:
>- Original Message - 
>From: "Gilberto Agostinho" 
>To: 
>Sent: Monday, March 24, 2014 12:49 PM
>Subject: Re: "dodecaphonic-first" accidental style
>
>
>> Urs Liska wrote
>>> David Nalesnik actually _did_ create a patch that I added to
>LilyPond. In
>>> 2.19 [...]
>>
>> This is wonderful!!! I recently installed version 2.19, but I didn't 
>> realize
>> this was added. Thanks for the information Urs!
>
>It's documented here:
>
>http://lilypond.org/doc/v2.19/Documentation/notation/displaying-pitches#automatic-accidentals
>
>--
>Phil Holmes 
>
>
>___
>lilypond-user mailing list
>lilypond-user@gnu.org
>https://lists.gnu.org/mailman/listinfo/lilypond-user

-- 
Diese Nachricht wurde mit https://play.google.com/store/apps/details?id=com.onegravity.k10.pro2";>K-@
 Mail gesendet.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: "dodecaphonic-first" accidental style

2014-03-24 Thread Phil Holmes
- Original Message - 
From: "Gilberto Agostinho" 

To: 
Sent: Monday, March 24, 2014 12:49 PM
Subject: Re: "dodecaphonic-first" accidental style



Urs Liska wrote

David Nalesnik actually _did_ create a patch that I added to LilyPond. In
2.19 [...]


This is wonderful!!! I recently installed version 2.19, but I didn't 
realize

this was added. Thanks for the information Urs!


It's documented here:

http://lilypond.org/doc/v2.19/Documentation/notation/displaying-pitches#automatic-accidentals

--
Phil Holmes 



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: "dodecaphonic-first" accidental style

2014-03-24 Thread Gilberto Agostinho
Gilberto Agostinho wrote
> The correct syntax is with the "s" [...]

I meant without without the "s", as in "repeat" and NOT "repeats"




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/dodecaphonic-first-accidental-style-tp141907p160773.html
Sent from the User mailing list archive at Nabble.com.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: "dodecaphonic-first" accidental style

2014-03-24 Thread Gilberto Agostinho
Urs Liska wrote
> David Nalesnik actually _did_ create a patch that I added to LilyPond. In
> 2.19 [...]

This is wonderful!!! I recently installed version 2.19, but I didn't realize
this was added. Thanks for the information Urs!


Urs Liska wrote
> \accidentalStyle 'dodecaphonic-no-repeat
> 
> (Or with an 's' at the end?)

The correct syntax is with the "s" and also without the apostrophe:
\accidentalStyle dodecaphonic-no-repeat

Thanks again, take care,
Gilberto



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/dodecaphonic-first-accidental-style-tp141907p160772.html
Sent from the User mailing list archive at Nabble.com.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: "dodecaphonic-first" accidental style

2014-03-24 Thread Urs Liska
David Nalesnik actually _did_ create a patch that I added to LilyPond. In 2.19 
you can write

\accidentalStyle 'dodecaphonic-no-repeat

(Or with an 's' at the end?)

which places dodecaphonic accidentals except when a pitch is repeated (in the 
same voice).

HTH
Urs

Gilberto Agostinho  schrieb am 24.03.2014:
>Rutger Hofman-2 wrote
>> [...]
>> As a fix, I made a small addition to music-functions.scm to add a 
>> dodecaphonic-first accidental style. Patch against 2.17.18-1
>attached.
>> [...]
>> Using dodecaphonic-first and adding ! here and there works fine for
>me.
>
>I already apologize for replying to an old post (almost 1 year old!),
>but I
>am really interested in this dodecaphonic-first accidental style. The
>problem is I do not know how to deal with this .patch file!
>
>Also, as Urs pointed out, this kind of accidental style is common
>practice
>in contemporary scores, so maybe it could be consider to be added as a
>feature to LilyPond. That would be great!
>
>Thanks a lot and best regards to you all,
>Gilberto
>
>
>
>--
>View this message in context:
>http://lilypond.1069038.n5.nabble.com/dodecaphonic-first-accidental-style-tp141907p160770.html
>Sent from the User mailing list archive at Nabble.com.
>
>___
>lilypond-user mailing list
>lilypond-user@gnu.org
>https://lists.gnu.org/mailman/listinfo/lilypond-user

-- 
Diese Nachricht wurde mit https://play.google.com/store/apps/details?id=com.onegravity.k10.pro2";>K-@
 Mail gesendet.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: "dodecaphonic-first" accidental style

2014-03-24 Thread Gilberto Agostinho
Rutger Hofman-2 wrote
> [...]
> As a fix, I made a small addition to music-functions.scm to add a 
> dodecaphonic-first accidental style. Patch against 2.17.18-1 attached.
> [...]
> Using dodecaphonic-first and adding ! here and there works fine for me.

I already apologize for replying to an old post (almost 1 year old!), but I
am really interested in this dodecaphonic-first accidental style. The
problem is I do not know how to deal with this .patch file!

Also, as Urs pointed out, this kind of accidental style is common practice
in contemporary scores, so maybe it could be consider to be added as a
feature to LilyPond. That would be great!

Thanks a lot and best regards to you all,
Gilberto



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/dodecaphonic-first-accidental-style-tp141907p160770.html
Sent from the User mailing list archive at Nabble.com.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Accidental style and \repeat percent

2013-07-11 Thread Davide Liessi
Hi all.

\version "2.17.21"
\relative c' {
  \accidentalStyle "modern"
  cis1
  c1
  \repeat percent 2 cis1
  c1
}

I would expect the last c to have a natural sign, like the one in the
second bar.
I know that the last printed cis is not in the previous bar, but the
last played cis is.
I think that cautionary accidentals are useful with respect to what
you last played, especially when you played the same thing many times
with the same accidentals (as in most percent repeats).

Is this intended or a bug?
If it is intended, is there a way to achieve what I want automatically
rather than manually placing cautionary accidentals?

Thanks to everyone.
Best wishes.
Davide

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: set-accidental-style

2013-07-11 Thread Phil Holmes
Have you read 
http://lilypond.org/doc/v2.16/Documentation/notation/displaying-pitches#automatic-accidentals
 ?

--
Phil Holmes


  - Original Message - 
  From: Peter O'Doherty 
  To: lilypond-user@gnu.org 
  Sent: Thursday, July 11, 2013 9:27 AM
  Subject: set-accidental-style


  Hi list,

  Where should the line  
  #(set-accidental-style 'dodecaphonic) 
  be added in a multi-part score to get it to apply to all parts?



  Adding it to the \Score block doesn't seem to work.



  Many thanks,
  Peter





-- 
//=
-> Peter O'Doherty
-> http://www.peterodoherty.net
-> m...@peterodoherty.net
//=


--


  ___
  lilypond-user mailing list
  lilypond-user@gnu.org
  https://lists.gnu.org/mailman/listinfo/lilypond-user
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


set-accidental-style

2013-07-11 Thread Peter O'Doherty

Hi list,

Where should the line

#(set-accidental-style 'dodecaphonic)
be added in a multi-part score to get it to apply to all parts?

Adding it to the \Score block doesn't seem to work.


Many thanks,
Peter



--
//=
-> Peter O'Doherty
-> http://www.peterodoherty.net
-> m...@peterodoherty.net
//=

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: "dodecaphonic-first" accidental style

2013-05-30 Thread Rutger Hofman

On 03/05/2013 12:05 PM, David G wrote:

I had been wondering that as well because I don't think it's all that
unusual, at least for early 20th century music (I have some Webern
scores printed in this way) but I couldn't see anything in the Lilypond
documentation.

If anyone has any suggestions I would be grateful too!


On 2 March 2013 22:07, Joseph Rushton Wakeling
mailto:joseph.wakel...@webdrake.net>> wrote:

Hello all,

Taking a look at Berg Op. 5 (see Sibelius-related discussion) I
realized that it uses a slight variant of the "dodecaphonic"
accidental style: every note has an accidental, but only for its
_first_ appearance in the bar.

Any advice on how to achieve this automatically?

Thanks & best wishes,

 -- Joe


For Berg scores, I used to use dodecaphonic accidental style with Urs 
Liska's suggestion to suppress rendering of the accidentals, but it has 
two drawbacks:

1) accidentals cannot be suppressed for single notes within a chord
2) suppressed accidentals still take space. That is visible in the 
spacing. Also, slurs/ties etc are curved around the invisible accidentals.


As a fix, I made a small addition to music-functions.scm to add a 
dodecaphonic-first accidental style. Patch against 2.17.18-1 attached.


For this Berg Op.5 score (which I am typesetting as a Lilypond exercise 
in piano music; will report later) this requires a number of additional 
force-accidental ! annotations because the style isn't precisely 
dodecaphonic-first, but my feeling is that using ! in dodecaphonic-first 
requires far fewer annotations than using dodecaphonic with Urs's 
accidental suppression.


Besides the Berg scores I looked at, I scanned a few Schoenberg and 
Webern scores, and in all of them, the accidental style is not something 
that would be easily automated. In some bars it is exactly 
dodecaphonic-first, in others accidentals are suppressed only for 
immediately repeated notes, and often it is some mixture. Using 
dodecaphonic-first and adding ! here and there works fine for me.


Rutger


--- usr/share/lilypond/current/scm/music-functions.scm	2013-05-27 09:45:16.273111287 +0200
+++ orig/usr/share/lilypond/current/scm/music-functions.scm	2013-05-11 17:17:14.0 +0200
@@ -1323,16 +1323,14 @@
 	 (car alteration-def))
 	(else 0)))
 
-(define (check-pitch-against-signature context pitch barnum laziness octaveness all-naturals)
+(define (check-pitch-against-signature context pitch barnum laziness octaveness)
   "Checks the need for an accidental and a @q{restore} accidental against
 @code{localKeySignature}.  The @var{laziness} is the number of measures
 for which reminder accidentals are used (i.e., if @var{laziness} is zero,
 only cancel accidentals in the same measure; if @var{laziness} is three,
 we cancel accidentals up to three measures after they first appear.
 @var{octaveness} is either @code{'same-octave} or @code{'any-octave} and
-specifies whether accidentals should be canceled in different octaves.
-If @var{all-naturals} is ##t, notes that do not occur in @code{keySignature}
-also get an accidental."
+specifies whether accidentals should be canceled in different octaves."
   (let* ((ignore-octave (cond ((equal? octaveness 'any-octave) #t)
 			  ((equal? octaveness 'same-octave) #f)
 			  (else
@@ -1390,7 +1388,7 @@
 	(let* ((prev-alt (extract-alteration previous-alteration))
 	   (this-alt (ly:pitch-alteration pitch)))
 
-	  (if (or (and all-naturals (eq? #f previous-alteration)) (not (= this-alt prev-alt)))
+	  (if (not (= this-alt prev-alt))
 	  (begin
 		(set! need-accidental #t)
 		(if (and (not (= this-alt 0))
@@ -1417,13 +1415,7 @@
 accidental lasts over that many bar lines.  @w{@code{-1}} is `forget
 immediately', that is, only look at key signature.  @code{#t} is `forever'."
 
-  (check-pitch-against-signature context pitch barnum laziness octaveness #f))
-
-(define-public ((make-accidental-dodecaphonic-rule octaveness laziness) context pitch barnum measurepos)
-  "Variation on function make-accidental-rule that creates an dodecaphonic
-accidental rule."
-
-  (check-pitch-against-signature context pitch barnum laziness octaveness #t))
+  (check-pitch-against-signature context pitch barnum laziness octaveness))
 
 (define (key-entry-notename entry)
   "Return the pitch of an @var{entry} in @code{localKeySignature}.
@@ -1613,13 +1605,6 @@
    `(Staff ,(lambda (c p bn mp) '(#f . #t)))
    '()
    context))
-  ;; Variety of the dodecaphonic style. Each note gets an accidental,
-  ;; except notes that were already handled in the same measure.
-  ((equal? style 'dodecaphonic-first)
-   (set-accidentals-properties #f
-   `(Staff ,(make-accidental-dodecaphonic-rule 'same-octave 0))
-   '()
-   context))
   ;; Multivoice accidentals to be read bo

Re: Changing accidental style for one section of a piece

2013-03-16 Thread Urs Liska

Am 15.03.2013 15:07, schrieb James Harkins:


Hi,

I'm working on a piece now where most of it is modal, but one section 
will be free-chromatic. I would like to use one of the more modern 
accidental styles, but only in that section.


I read the section of the manual about automatic accidentals, and it 
appears at first glance that the accidental style should be set per 
staff (possibly evaluating globally for the staff, possibly per 
voice). It wasn't clear if the style could change in the middle of a 
piece. So, I'm asking: is that possible? Or is it expected that the 
same accidental style should apply throughout a staff's duration?


Thanks,
hjh


Of course you can do that anywhere and multiple times in a piece (as 
others have pointed out).
I think you'll have to do it in each staff individually, though (other 
than, say a \time change or other commands that are at score level.


HTH
Urs



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Changing accidental style for one section of a piece

2013-03-16 Thread David Kastrup
James Harkins  writes:

> I'm working on a piece now where most of it is modal, but one section
> will be free-chromatic. I would like to use one of the more modern
> accidental styles, but only in that section.
>
> I read the section of the manual about automatic accidentals, and it
> appears at first glance that the accidental style should be set per
> staff (possibly evaluating globally for the staff, possibly per
> voice). It wasn't clear if the style could change in the middle of a
> piece. So, I'm asking: is that possible? Or is it expected that the
> same accidental style should apply throughout a staff's duration?

I can assure you that your computer won't explode if you tried out just
that.  At any rate, settings that can be written inside of music can
usually also modified inside of music.

-- 
David Kastrup


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Changing accidental style for one section of a piece

2013-03-15 Thread Keith OHara
James Harkins  gmail.com> writes:

> I would like to use one of the more modern accidental styles, 
> but only in that section.

> It wasn't clear if the style could change in the middle of a piece.

I would think it should work.
So far, it works for me to put \accidentalStyle in the middle of music.


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Changing accidental style for one section of a piece

2013-03-15 Thread James Harkins
Hi,

I'm working on a piece now where most of it is modal, but one section will
be free-chromatic. I would like to use one of the more modern accidental
styles, but only in that section.

I read the section of the manual about automatic accidentals, and it
appears at first glance that the accidental style should be set per staff
(possibly evaluating globally for the staff, possibly per voice). It wasn't
clear if the style could change in the middle of a piece. So, I'm asking:
is that possible? Or is it expected that the same accidental style should
apply throughout a staff's duration?

Thanks,
hjh
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: "dodecaphonic-first" accidental style

2013-03-05 Thread Urs Liska

Am 05.03.2013 12:20, schrieb David G:
Actually on closer inspection the Webern score I was referring does 
*not* have the same method of accidentals as the Universal edition of 
the Berg piece - accidentals are only omitted when a pitch is 
immediately repeated in the same octave (I think that's actually more 
readable especially when bars can be very long).

That's also a quite common practice with contemporary scores.



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: "dodecaphonic-first" accidental style

2013-03-05 Thread David G
Actually on closer inspection the Webern score I was referring does *not*
have the same method of accidentals as the Universal edition of the Berg
piece - accidentals are only omitted when a pitch is immediately repeated
in the same octave (I think that's actually more readable especially when
bars can be very long).


On 5 March 2013 11:05, David G  wrote:

> I had been wondering that as well because I don't think it's all that
> unusual, at least for early 20th century music (I have some Webern scores
> printed in this way) but I couldn't see anything in the Lilypond
> documentation.
>
> If anyone has any suggestions I would be grateful too!
>
>
> On 2 March 2013 22:07, Joseph Rushton Wakeling <
> joseph.wakel...@webdrake.net> wrote:
>
>> Hello all,
>>
>> Taking a look at Berg Op. 5 (see Sibelius-related discussion) I realized
>> that it uses a slight variant of the "dodecaphonic" accidental style: every
>> note has an accidental, but only for its _first_ appearance in the bar.
>>
>> Any advice on how to achieve this automatically?
>>
>> Thanks & best wishes,
>>
>> -- Joe
>>
>> __**_
>> lilypond-user mailing list
>> lilypond-user@gnu.org
>> https://lists.gnu.org/mailman/**listinfo/lilypond-user<https://lists.gnu.org/mailman/listinfo/lilypond-user>
>>
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: "dodecaphonic-first" accidental style

2013-03-05 Thread David G
I had been wondering that as well because I don't think it's all that
unusual, at least for early 20th century music (I have some Webern scores
printed in this way) but I couldn't see anything in the Lilypond
documentation.

If anyone has any suggestions I would be grateful too!


On 2 March 2013 22:07, Joseph Rushton Wakeling  wrote:

> Hello all,
>
> Taking a look at Berg Op. 5 (see Sibelius-related discussion) I realized
> that it uses a slight variant of the "dodecaphonic" accidental style: every
> note has an accidental, but only for its _first_ appearance in the bar.
>
> Any advice on how to achieve this automatically?
>
> Thanks & best wishes,
>
> -- Joe
>
> __**_
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/**listinfo/lilypond-user<https://lists.gnu.org/mailman/listinfo/lilypond-user>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


"dodecaphonic-first" accidental style

2013-03-02 Thread Joseph Rushton Wakeling

Hello all,

Taking a look at Berg Op. 5 (see Sibelius-related discussion) I realized that it 
uses a slight variant of the "dodecaphonic" accidental style: every note has an 
accidental, but only for its _first_ appearance in the bar.


Any advice on how to achieve this automatically?

Thanks & best wishes,

-- Joe

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Accidental style like dodecaphonic, but not quite the same

2012-11-13 Thread Urs Liska

Am 12.11.2012 19:16, schrieb Rutger Hofman:

Hello list,

I am typesetting a piece by Alban Berg. Its accidental style is like Lilypond's 
dodecaphonic (explicit accidental for each note), but it differs in that 
immediately repeated notes within a bar don't get an accidental. How can I make 
an accidental style that does exactly this?

And related: is there a way to remove one note's explicit accidental even when 
a style prescribes it?

I have a helper function in my 'toolbox' that will help you:

suppressAccidental = {
 \once \override Accidental #'stencil = ##f
}

Of course you can simply use the second line, without the surrounding 
variable definition.


HTH
Urs




Thanks,

Rutger Hofman
Amsterdam
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Accidental style like dodecaphonic, but not quite the same

2012-11-12 Thread Rutger Hofman
Hello list,

I am typesetting a piece by Alban Berg. Its accidental style is like Lilypond's 
dodecaphonic (explicit accidental for each note), but it differs in that 
immediately repeated notes within a bar don't get an accidental. How can I make 
an accidental style that does exactly this?

And related: is there a way to remove one note's explicit accidental even when 
a style prescribes it?

Thanks,

Rutger Hofman
Amsterdam
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: contemporary accidental style

2012-05-21 Thread Orm Finnendahl
Am Montag, den 21. Mai 2012 um 16:18:16 Uhr (+0200) schrieb Orm Finnendahl:
> The example for neo-modern in the documentation actually is an
> excellent example for a situation where the musician has to ask about
> the second fis because it's not obvious if the accidental has been
> accidentally forgotten and whether it's an f or a fis.

sorry, I meant the second cis' in the first bar of the upper staff,
which seems to contrast the repeated accidental of the fis on the same
beat in the lower staff.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: contemporary accidental style

2012-05-21 Thread Orm Finnendahl
Am Montag, den 21. Mai 2012 um 15:58:14 Uhr (+0200) schrieb Jan Nieuwenhuizen:

> Question is: is neo-modern used and appreciated as it works right now
> and do we indeed need a "contemporary" style, or should neo-modern
> behave like Orm describes?

I would opt for that. The only situation, I know of, where accidentals
aren't repeated on direct repetition, are in situations with lots of
fast repetitions, like in saltando actions for strings, but in those
situations often the noteheads except for the first one are omitted as
well to save space. And I've also seen the repetition of accidentals
in those cases just to make it perfectly clear.

The example for neo-modern in the documentation actually is an
excellent example for a situation where the musician has to ask about
the second fis because it's not obvious if the accidental has been
accidentally forgotten and whether it's an f or a fis.

--
Orm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: contemporary accidental style

2012-05-21 Thread Jan Nieuwenhuizen
Orm Finnendahl writes:

>> \accidentalStyle "neo-modern" does not match your requirements?
>
> its close, but the immediate repetition is the problem. I encounter
> calls by musicians quite often if I don't explicitely restate the
> accidental (even if it's stated in the foreword).

Question is: is neo-modern used and appreciated as it works right now
and do we indeed need a "contemporary" style, or should neo-modern
behave like Orm describes?

Jan

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: contemporary accidental style

2012-05-21 Thread Jonas Olson

On 2012-05-21 13:09, Orm Finnendahl wrote:

My suggestion for the name of this style would be "contemporary"
That only works from our particular point of view. If someone runs 
Lilypond sometime far into the distant future or in the distant past, 
they wouldn't see it as contemporary. I'd suggest a name that can be 
independent of time.


Jonas

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: contemporary accidental style

2012-05-21 Thread Orm Finnendahl
Am Montag, den 21. Mai 2012 um 15:37:33 Uhr (+0200) schrieb David Kastrup:
> 
> \accidentalStyle "neo-modern" does not match your requirements?
> 

its close, but the immediate repetition is the problem. I encounter
calls by musicians quite often if I don't explicitely restate the
accidental (even if it's stated in the foreword).

--
Orm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: contemporary accidental style

2012-05-21 Thread David Kastrup
Orm Finnendahl  writes:

> Hi,
>
>  for years I'm sorely missing an accidental style for contemporary
> music, which I always use and which is quite common among contemporary
> composers in my experience. At the moment it requires quite some extra
> work in every score implementing the accidentals explicitely although
> its behaviour can be defined precisely.
>
> The style I'm looking for always prints accidentals on every note
> except for naturals which are only written in cancellation cases at
> the first occurence (also across octaves and across one barline).

\accidentalStyle "neo-modern" does not match your requirements?

-- 
David Kastrup


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


contemporary accidental style

2012-05-21 Thread Orm Finnendahl
Hi,

 for years I'm sorely missing an accidental style for contemporary
music, which I always use and which is quite common among contemporary
composers in my experience. At the moment it requires quite some extra
work in every score implementing the accidentals explicitely although
its behaviour can be defined precisely.

The style I'm looking for always prints accidentals on every note
except for naturals which are only written in cancellation cases at
the first occurence (also across octaves and across one barline).

I'm not sure how to go about it. Reading the source it seems feasible
to do although I don't understand all of the code (yet). If it's easy
for any of the developers to accompish I'd be very grateful for
that. Otherwise I'd be interested whether there is a way to do it
within a score file using some function or whether I should go ahead
and try to submit a patch for the sources (and whether you think it's
worthwile to integrate into lilypond).

My suggestion for the name of this style would be "contemporary" and
I'd be glad to submit the information for the docs.

Yours,
Orm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: \cadenzaOn + accidental-style not working

2012-04-08 Thread Wasil Sergejczyk
oops, sorry, i put #(set-accidental-style 'forget) in the wrong place. all
works npw.

2012/4/8 James 

> Hello,
>
> On 8 April 2012 10:36, Wasil Sergejczyk  wrote:
> > when i set \cadenzaOn, set-accidental-style has no effect. do i use it
> > correctly? is it a bug or a feature? are there any workarounds?
>
> Remember when you set a \cadenzaOn it is like one giant *single*
> measure - even if you put in \bar "|", until *after* cadenzaOff, so
> you have to manually set your Accidentals.
>
> Hope that helps.
>
> James
>
> >
> >
> >> \version "2.15.36"
> >> \include "italiano.ly"
> >> global = {
> >> \cadenzaOn
> >> \key do \major
> >> \autoBeamOff
> >> \pointAndClickOff
> >> \override Staff.NoteHead #'style = #'altdefault
> >> #(set-accidental-style 'forget)
> >> }
> >> melody = {
> >> \global
> >> \clef "alto"
> >> \transpose do do' {
> >> do re mi fa sol la sib do' sib
> >> }
> >> }
> >> \score {
> >> <<
> >> \new Staff { \melody }
> >> >>
> >> \layout {
> >> %indent = 0
> >> \context {
> >> \Staff
> >> \remove "Time_signature_engraver"
> >> }
> >> \context {
> >> \Score
> >> \override BarNumber #'transparent = ##t
> >> }
> >> }
> >
> > thanks in advance.
> > --
> > Best regards.
> >
> > ___
> > lilypond-user mailing list
> > lilypond-user@gnu.org
> > https://lists.gnu.org/mailman/listinfo/lilypond-user
> >
>



-- 
Best regards.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: \cadenzaOn + accidental-style not working

2012-04-08 Thread James
Hello,

On 8 April 2012 10:36, Wasil Sergejczyk  wrote:
> when i set \cadenzaOn, set-accidental-style has no effect. do i use it
> correctly? is it a bug or a feature? are there any workarounds?

Remember when you set a \cadenzaOn it is like one giant *single*
measure - even if you put in \bar "|", until *after* cadenzaOff, so
you have to manually set your Accidentals.

Hope that helps.

James

>
>
>> \version "2.15.36"
>> \include "italiano.ly"
>> global = {
>> \cadenzaOn
>> \key do \major
>> \autoBeamOff
>> \pointAndClickOff
>> \override Staff.NoteHead #'style = #'altdefault
>> #(set-accidental-style 'forget)
>> }
>> melody = {
>> \global
>> \clef "alto"
>> \transpose do do' {
>> do re mi fa sol la sib do' sib
>> }
>> }
>> \score {
>> <<
>> \new Staff { \melody }
>> >>
>> \layout {
>> %indent = 0
>> \context {
>> \Staff
>> \remove "Time_signature_engraver"
>> }
>> \context {
>> \Score
>> \override BarNumber #'transparent = ##t
>> }
>> }
>
> thanks in advance.
> --
> Best regards.
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


\cadenzaOn + accidental-style not working

2012-04-08 Thread Wasil Sergejczyk
when i set \cadenzaOn, set-accidental-style has no effect. do i use it
correctly? is it a bug or a feature? are there any workarounds?


\version "2.15.36"
> \include "italiano.ly"
> global = {
> \cadenzaOn
> \key do \major
> \autoBeamOff
> \pointAndClickOff
> \override Staff.NoteHead #'style = #'altdefault
> #(set-accidental-style 'forget)
> }
> melody = {
> \global
> \clef "alto"
> \transpose do do' {
> do re mi fa sol la sib do' sib
> }
> }
> \score {
> <<
> \new Staff { \melody }
> >>
> \layout {
> %indent = 0
> \context {
> \Staff
> \remove "Time_signature_engraver"
> }
> \context {
> \Score
> \override BarNumber #'transparent = ##t
> }
> }

thanks in advance.
-- 
Best regards.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: accidental style - cancel note within chord

2011-11-30 Thread Keith OHara

On Wed, 30 Nov 2011 11:33:26 -0800, Neil Thornock  
wrote:


How do I submit an enhancement request?  To "bugs"?


Yes, with the shortest LilyPond example that makes the point clear, and a 
description of the desired output.  Maybe

\version "2.14"
{ #(set-accidental-style 'modern)
 gis'' << gis'' \\ g' >> }
%
% In the second beat, the gis'' should be printed with a sharp sign
% and the g' should (continue to) be printed with a natural sign.
%
% In general, if the chosen accidental-style would print an accidental sign
% with a note either (1) if there were no other simultaneous notes, or
% (2) if the simultaneous notes were instead just before the note in question,
% then we want that accidental to be printed.

but I don't know if that expresses the important point.  I don't have much 
exposure to modern music.


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: accidental style - cancel note within chord

2011-11-30 Thread Neil Thornock
Yes, that makes sense.

How do I submit an enhancement request?  To "bugs"?

On Tue, Nov 29, 2011 at 7:47 PM, Keith OHara  wrote:
> Neil Thornock  gmail.com> writes:
>
>> Is there a way to create an accidental style that
>> checks for *simultaneous* pitches in any octave, resulting, in this
>> example, in a natural on the top note?
>>
>
>
> No, unfortunately; the information available to the accidental-setting rule
> is only the set of accidentals in /previous/ notes and key signature. An
> unfortunate design choice, but one I can forgive because in traditional
> music simultaneous conflicting accidentals are rare.
>
> No doubt, you know how to force accidentals. 
>
> I don't see an enhancement request to solve this problem; the closest
> is <http://code.google.com/p/lilypond/issues/detail?id=1134>.  The manual
> does explain the limitation in the section on
> Pitches::DisplayingPitches::AutomaticAccidentals.
>
>
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user



-- 
Neil Thornock, D.M.
No Stopping, Standing, or Parking:
http://neilthornock.net/mp3s/nostopping.mp3
Assistant Professor of Music
Composition/Theory
Brigham Young University

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: accidental style - cancel note within chord

2011-11-29 Thread Keith OHara
Neil Thornock  gmail.com> writes:

> Is there a way to create an accidental style that
> checks for *simultaneous* pitches in any octave, resulting, in this
> example, in a natural on the top note?
> 


No, unfortunately; the information available to the accidental-setting rule 
is only the set of accidentals in /previous/ notes and key signature. An 
unfortunate design choice, but one I can forgive because in traditional 
music simultaneous conflicting accidentals are rare.

No doubt, you know how to force accidentals. 

I don't see an enhancement request to solve this problem; the closest
is <http://code.google.com/p/lilypond/issues/detail?id=1134>.  The manual
does explain the limitation in the section on 
Pitches::DisplayingPitches::AutomaticAccidentals.



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: accidental style - cancel note within chord

2011-11-29 Thread Neil Thornock
While I'm at it, try the following:

{ #(set-accidental-style 'neo-modern)  }

Yuck!  I don't think this should ever be the result of any accidental
rule (e-flat only on the first bottom note, e-natural on every note
*except* the first note).

On Tue, Nov 29, 2011 at 10:57 AM, Neil Thornock  wrote:
> I've been frustrated with the available accidental styles.  While I
> could do all this manually -- ugh!
>
> The modern and neo-modern approaches are best aligned with my
> sensibilities, but there is one situation in which I think they fall
> short.
>
> If I write the following:
>
> { #(set-accidental-style 'neo-modern) ees e' }
>
> The second note gets a natural -- I like it.  If I write:
>
> { #(set-accidental-style 'neo-modern)  }
>
> The top note gets nothing -- no accidental -- which seems to me
> inconsistent.  Is there a way to create an accidental style that
> checks for *simultaneous* pitches in any octave, resulting, in this
> example, in a natural on the top note?
>
> --
> Neil Thornock, D.M.
> No Stopping, Standing, or Parking:
> http://neilthornock.net/mp3s/nostopping.mp3
> Assistant Professor of Music
> Composition/Theory
> Brigham Young University



-- 
Neil Thornock, D.M.
No Stopping, Standing, or Parking:
http://neilthornock.net/mp3s/nostopping.mp3
Assistant Professor of Music
Composition/Theory
Brigham Young University

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


accidental style - cancel note within chord

2011-11-29 Thread Neil Thornock
I've been frustrated with the available accidental styles.  While I
could do all this manually -- ugh!

The modern and neo-modern approaches are best aligned with my
sensibilities, but there is one situation in which I think they fall
short.

If I write the following:

{ #(set-accidental-style 'neo-modern) ees e' }

The second note gets a natural -- I like it.  If I write:

{ #(set-accidental-style 'neo-modern)  }

The top note gets nothing -- no accidental -- which seems to me
inconsistent.  Is there a way to create an accidental style that
checks for *simultaneous* pitches in any octave, resulting, in this
example, in a natural on the top note?

-- 
Neil Thornock, D.M.
No Stopping, Standing, or Parking:
http://neilthornock.net/mp3s/nostopping.mp3
Assistant Professor of Music
Composition/Theory
Brigham Young University

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Set accidental style in the layout block

2011-07-03 Thread Kieren MacMillan
Hi Bill,

> Unfortunately such an exercise is beyond my abilities. :(

Well, for the archive, here's a quick stab at a few:

\version "2.15.3"

\layout { indent = 1.2\in }

accidentalsDefault = \with {
  skipBars = ##t
  extraNatural = ##f
  autoAccidentals = #`(Staff ,(make-accidental-rule 'same-octave 0))
}
accidentalsVoice = \with {
  skipBars = ##t
  extraNatural = ##f
  autoAccidentals = #`(Voice ,(make-accidental-rule 'same-octave 0))
}
accidentalsModern = \with {
  skipBars = ##t
  extraNatural = ##f
  autoAccidentals = #`(Staff ,(make-accidental-rule 'same-octave 0)
 ,(make-accidental-rule 'any-octave 0)
 ,(make-accidental-rule 'same-octave 1))
}
accidentalsDodecaphonic = \with {
  skipBars = ##t
  extraNatural = ##f
  autoAccidentals = #`(Staff ,(lambda (c p bn mp) '(#f . #t)))
}
accidentalsForget = \with {
  skipBars = ##t
  extraNatural = ##f
  autoAccidentals = #`(Staff ,(make-accidental-rule 'same-octave -1))
}
accidentalsNoReset = \with {
  skipBars = ##t
  extraNatural = ##f
  autoAccidentals = #`(Staff ,(make-accidental-rule 'same-octave #t))
}

theNotes = \relative c' {
  c8 fis bes aes a aes a aes
  eis8 f fis g ges a ges g
}

\score {
  <<
\new Staff \with { instrumentName = "Default" \accidentalsDefault } 
\theNotes
\new Staff \with { instrumentName = "Forget" \accidentalsForget } \theNotes
\new Staff \with { instrumentName = "Modern" \accidentalsModern } \theNotes
\new Staff \with { instrumentName = "NoReset" \accidentalsNoReset } 
\theNotes
\new Staff \with { instrumentName = "Dodecaphonic" \accidentalsDodecaphonic 
} \theNotes
  >>
}

Hopefully someone with more time than I currently have will grab the ball and 
run with it.

Hope this helps!
Kieren.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Set accidental style in the layout block

2011-07-03 Thread Bill Mooney

Hi Kieren,
You wrote...
++
Hello all,
Since \with blocks can now contain variables, maybe someone should put 
together

all of the options and submit a patch?
Then it wouldn't involve more typing.
;)
Cheers,
Kieren.
++
Unfortunately such an exercise is beyond my abilities. :(
I am impressed by LP's capabilities in general, and it's ability to do 
something in several different ways... -but that must make compiling a 
user-friendly 'Manual' something of a head-ache -added to which is LP's 
'extensibility' if one is prepared, and able, to get into the 
programming side of things. I must admit that, in the few projects I've 
undertaken (notating hand-written polyphony for choir use), I've made 
considerable use of the templates in the Manuals, and applied such 
tweaks as have been necessary, with recourse, from time to time, to help 
from the List community.

Regards
Bill


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Set accidental style in the layout block

2011-07-02 Thread Kieren MacMillan
Hello all,

Since \with blocks can now contain variables, maybe someone should put together 
all of the options and submit a patch?
Then it wouldn't involve more typing.
;)

Cheers,
Kieren.

On 2011-Jul-2, at 04:39, Xavier Scheuer wrote:

> On 2 July 2011 08:46, Bill Mooney  wrote:
>> 
>> As in the example below - based on the NM example... Where the
>> accidentals definition is in the \layout block, as in yours.
>> What I'm not clear about is why a different method has been used which
>> seems to involve more typing and doesn't seem to offer the variety that
>> the NM example does. - modern, modern-cautionary, modern-voice, etc.,
>> etc. ...
>> 
>> […]
>> 
>> ...and I agree with these principles - of keeping things well-ordered
>> and as simple and as flexible as possible.
>> :)
> 
> Actually it _does_ offer the variety of modern, modern-cautionary,
> modern-voice, etc.  You can consider the music functions
>  #(set-accidental-style …)  as some "shortcuts" for
>  autoAccidentals = … .
> In fact, the "autoAccidentals" method permit other new, customized
> accidental styles that does not exist as
>  #(set-accidental-style argument) .
> 
> As Jay said, the main advantage is that it does not necessitate to
> be inserted within a music expressions (as opposed to the music
> function), which can permit, for example, to have different layout
> from one source easily.
> I for example use a separate file for the layout (as well as separate
> files for the notes of each instrument).  If I want for example a
> "modern" edition of one source, with modern accidental style and bar
> numbers, I include "layout-modern" containing these definitions.
> If I want an "oldstyle" edition with default accidental style, no bar
> numbers and extra naturals, I include "layout-oldstyle".
> 
> Cheers,
> Xavier
> 
> -- 
> Xavier Scheuer 
> 
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Set accidental style in the layout block

2011-07-02 Thread Xavier Scheuer
On 2 July 2011 08:46, Bill Mooney  wrote:
>
> As in the example below - based on the NM example... Where the
> accidentals definition is in the \layout block, as in yours.
> What I'm not clear about is why a different method has been used which
> seems to involve more typing and doesn't seem to offer the variety that
> the NM example does. - modern, modern-cautionary, modern-voice, etc.,
> etc. ...
>
> […]
>
> ...and I agree with these principles - of keeping things well-ordered
> and as simple and as flexible as possible.
> :)

Actually it _does_ offer the variety of modern, modern-cautionary,
modern-voice, etc.  You can consider the music functions
  #(set-accidental-style …)  as some "shortcuts" for
  autoAccidentals = … .
In fact, the "autoAccidentals" method permit other new, customized
accidental styles that does not exist as
  #(set-accidental-style argument) .

As Jay said, the main advantage is that it does not necessitate to
be inserted within a music expressions (as opposed to the music
function), which can permit, for example, to have different layout
from one source easily.
I for example use a separate file for the layout (as well as separate
files for the notes of each instrument).  If I want for example a
"modern" edition of one source, with modern accidental style and bar
numbers, I include "layout-modern" containing these definitions.
If I want an "oldstyle" edition with default accidental style, no bar
numbers and extra naturals, I include "layout-oldstyle".

Cheers,
Xavier

-- 
Xavier Scheuer 

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Set accidental style in the layout block

2011-07-01 Thread Bill Mooney



 Original Message 
Subject: Re: Set accidental style in the layout block
Date: Sat, 02 Jul 2011 18:16:44 +1200
From: Bill Mooney 
To: horndud...@gmail.com

You wrote...


It should do about the same thing. The main advantage is that it
avoids littering files with #(set-accidental-style ...). You put it in
only one spot.


As in the example below - based on the NM example... Where the
accidentals definition is in the \layout block, as in yours.
What I'm not clear about is why a different method has been used which
seems to involve more typing and doesn't seem to offer the variety that
the NM example does. - modern, modern-cautionary, modern-voice, etc.,
etc. ...


If you chose to change it there's only one place to
modify. I like to put it in a separate file (e.g. defs.ily) and
include it into all of the different lilypond files that generate
scores (e.g. violin.ly, piano.ly, etc.). If you're entering something
with only one line of music I think there's still an advantage in
being able to reuse previous definition files.



Here's an instrument+piano example for how I generally like to lay
projects out. I think it keeps each individual file tidy and avoid
duplicating settings in each staff.
* Put as many changes/tweaks from defaults as possible in the file
where you keep your main layout block file.
* Keep a separate outline to put bars, tempos, marks, etc.
* Keep music definitions in separate files from layout.


...and I agree with these principles - of keeping things well-ordered
and as simple and as flexible as possible.
:)
Regards
Bill




\version "2.14.1"
\header
{
title = "Accidentals"
 }

musicA =
\relative c'
{
<<
 {
cis'8 fis, bes4 8 f bis4
cis2. 4 |
}
\\
 {
ais'2 cis,
fis8 b a4 cis2
}



}
musicB = \relative c' {
\clef bass
8 
cis' cis
 
dis'4
4 gis 2


}
\score {
\new PianoStaff {
<<
\context Staff = "up" {
#(set-accidental-style 'modern)
\musicA
}
\context Staff = "down" {
#(set-accidental-style 'modern)
\musicB
}



}
}

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Set accidental style in the layout block

2011-07-01 Thread Jay Anderson
On Fri, Jul 1, 2011 at 8:54 PM, Bill Mooney  wrote:
> Does this achieve something different from what the NM example I quoted
> does? and, if so, what?

It should do about the same thing. The main advantage is that it
avoids littering files with #(set-accidental-style ...). You put it in
only one spot. If you chose to change it there's only one place to
modify. I like to put it in a separate file (e.g. defs.ily) and
include it into all of the different lilypond files that generate
scores (e.g. violin.ly, piano.ly, etc.). If you're entering something
with only one line of music I think there's still an advantage in
being able to reuse previous definition files.

Here's an instrument+piano example for how I generally like to lay
projects out. I think it keeps each individual file tidy and avoid
duplicating settings in each staff.
* Put as many changes/tweaks from defaults as possible in the file
where you keep your main layout block file.
* Keep a separate outline to put bars, tempos, marks, etc.
* Keep music definitions in separate files from layout.

defs.ily
=
\version "2.14.1"

\layout
{
  \context
  {
\Score
skipBars = ##t
extraNatural = ##f
autoAccidentals = #`(Staff ,(make-accidental-rule 'same-octave 0)
   ,(make-accidental-rule 'any-octave 0)
   ,(make-accidental-rule 'same-octave 1))
  }
}
=

flute.ily
=
\version "2.14.1"

flute = \relative c''
{
  \key ees \major
  ees4 e8 ges f16 e ees d cis8 a |
  a'4 aes g2 |
}
=

flute.ily
=
\version "2.14.1"

\include "defs.ily"
\include "outline.ily"
\include "flute.ily"

\score
{
  \new Staff << \flute \outline >>
}
=

outline.ily
=
\version "2.14.1"

outline =
{
  \tempo "Friabile" 4=120
  s1*2 | \bar "|."
}
=

piano.ily
=
\version "2.14.1"

top = \relative c'
{
  \clef treble
  \key ees \major
  ees4 e f fis |
  f2 ees |
}

bot = \relative c
{
  \clef bass
  \key ees \major
  ees4 c b cis |
  d2 ees |
}

dyn =
{
  s1\f |
  s\p |
}
=

piano.ly
=
\version "2.14.1"

\include "defs.ily"
\include "outline.ily"
\include "flute.ily"
\include "piano.ily"

\score
{
  <<
\new Staff \flute
\new PianoStaff
<<
  \new Staff=top << \top \outline >>
  \new Dynamics \dyn
  \new Staff=bot \bot
>>
  >>
  \layout{}
  \midi{}
}
=

-Jay

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Set accidental style in the layout block

2011-07-01 Thread Bill Mooney

You wote...

On 1 July 2011 07:47, Jay Anderson  wrote:
>
> \layout
> {
>  \context
>  {
>\Score
>...
>autoAccidentals = #`(Staff ,(make-accidental-rule 'same-octave 0)
>   ,(make-accidental-rule 'any-octave 0)
>   ,(make-accidental-rule 'same-octave 1))
>...
>  }
> }
>
> See music-function.scm for how they are defined and engraver-init.ly
> for some examples. Ideally this would be cleaner, but at least it's
> possible.

Yeah!  That works great.
Thanks a lot Jay.

Cheers,
Xavier

Greetings Xavier & Jay,

Does this achieve something different from what the NM example I quoted 
does? and, if so, what?

:)
Regards
Bill

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Set accidental style in the layout block

2011-07-01 Thread Carl Sorensen



On 7/1/11 4:57 AM, "Xavier Scheuer"  wrote:

> On 1 July 2011 07:47, Jay Anderson  wrote:
>> 
>> \layout
>> {
>>  \context
>>  {
>>\Score
>>...
>>autoAccidentals = #`(Staff ,(make-accidental-rule 'same-octave 0)
>>   ,(make-accidental-rule 'any-octave 0)
>>   ,(make-accidental-rule 'same-octave 1))
>>...
>>  }
>> }
>> 
>> See music-function.scm for how they are defined and engraver-init.ly
>> for some examples. Ideally this would be cleaner, but at least it's
>> possible.
> 
> Yeah!  That works great.
> Thanks a lot Jay.

Can we get an LSR entry with a docs tag for this?

Thanks,

Carl


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Set accidental style in the layout block

2011-07-01 Thread Xavier Scheuer
On 1 July 2011 07:47, Jay Anderson  wrote:
>
> \layout
> {
>  \context
>  {
>\Score
>...
>autoAccidentals = #`(Staff ,(make-accidental-rule 'same-octave 0)
>   ,(make-accidental-rule 'any-octave 0)
>   ,(make-accidental-rule 'same-octave 1))
>...
>  }
> }
>
> See music-function.scm for how they are defined and engraver-init.ly
> for some examples. Ideally this would be cleaner, but at least it's
> possible.

Yeah!  That works great.
Thanks a lot Jay.

Cheers,
Xavier

-- 
Xavier Scheuer 

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


  1   2   >