Menu

#2575 Ambitus is incorrect in the case of semitone staves

Verified
Enhancement
2020-05-01
2012-05-30
Anonymous
No

Originally created by: *anonymous

Originally created by: colingh...@gmail.com

Barikavily reported here:

http://lists.gnu.org/archive/html/bug-lilypond/2012-05/msg00217.html

Original post:
-------------------------

> I'm not top posting.
% Ambitus is not correct in the case of:
% Manually defined clefs (here the example of the standard choral tenor clef)
% Semitone staves

\version "2.15.35"

\new Staff \with { \consists Ambitus_engraver } {
        \set Staff.middleCPosition = #1
        c' c''
}

\new Staff \with { \consists Ambitus_engraver } {
        \set staffLineLayoutFunction = #ly:pitch-semitones
        c' c''
}

--------------------------

I think the first example is expected behaviour but the second one is a new bug.

http://lilypond.org/doc/v2.15/Documentation/notation/displaying-pitches#ambitus
http://lilypond.org/doc/v2.15/Documentation/notation/displaying-pitches#clef
https://code.google.com/p/lilypond/issues/list?can=1&q=ambitus

https://codereview.appspot.com/341520043

Discussion

  • Google Importer

    Google Importer - 2012-05-30

    Originally posted by: dak@gnu.org

    I don't expect LilyPond to guess ahead, so I would only expect reasonably correct results when using

    \new Staff \with
      { \consists Ambitus_engraver
        middleCPosition = #1 }
    {
            c' c''
    }

    \new Staff \with
      { \consists Ambitus_engraver
        staffLineLayoutFunction = #ly:pitch-semitones }
    {
            c' c''
    }

    However, this "time-invariant" way of establishing the settings does not actually produce a result different from the original example, and so definitely a fix seems required.

     
  • Google Importer

    Google Importer - 2012-06-03

    Originally posted by: colingh...@gmail.com

    My analysis of this bug report was incorrect.

    Both of the cases reported by Barikavily are unexpected behaviour, not just the second one.

    Cheers,
    Colin.

     
  • Malte Meyn

    Malte Meyn - 2018-09-30
    • Description has changed:

    Diff:

    
    
    • status: Accepted --> Started
    • assigned_to: Malte Meyn
    • Needs: -->
    • Patch: -->
     
  • David Kastrup

    David Kastrup - 2018-09-30

    If I remember correctly, in the regtests or somewhere else a complete rewrite of the Ambitus_engraver in Scheme was done. It hasn't become the default because Scheme engravers could not be registered, documented and used identically to C++ engravers, making it a compatibility problem. Now this might still be a performance issue, but overall I think that now that registering Scheme engravers is equivalent to registering C++ engravers in all respect (and we do have a few already), it might be feasible to revisit the decision to move this into the Scheme realm for good since it makes it more accessible to tinkering.

     
    • Malte Meyn

      Malte Meyn - 2018-09-30

      Ok, I’ll look for that rewrite. (Edit: It’s Snippet 805)

      I haven’t done many changes yet but part 1 of this issue (middleCPosition) already works. For part 2 (staffLineLayoutFunction) I tried to copy from note-heads-engraver.cc but I haven’t found a way to convert Pitch to SCM in order to feed it to scm_call_1 (see also line 85 of note-heads-engraver.cc).

       

      Last edit: Malte Meyn 2018-09-30
  • Malte Meyn

    Malte Meyn - 2018-12-08
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -33,3 +33,5 @@
     [http://lilypond.org/doc/v2.15/Documentation/notation/displaying-pitches#ambitus](http://lilypond.org/doc/v2.15/Documentation/notation/displaying-pitches#ambitus)
     [http://lilypond.org/doc/v2.15/Documentation/notation/displaying-pitches#clef](http://lilypond.org/doc/v2.15/Documentation/notation/displaying-pitches#clef)
     [https://code.google.com/p/lilypond/issues/list?can=1&q=ambitus](https://code.google.com/p/lilypond/issues/list?can=1&q=ambitus)
    +
    +https://codereview.appspot.com/341520043
    
    • Needs: -->
    • Type: -->
     
  • Anonymous

    Anonymous - 2018-12-10
    • Patch: new --> review
    • Type: --> Enhancement
     
  • Anonymous

    Anonymous - 2018-12-10

    Passes make, make check and a full make doc.

     
  • Anonymous

    Anonymous - 2018-12-12
    • Patch: review --> push
     
  • Anonymous

    Anonymous - 2018-12-12

    Patch counted down - please push.

     
    • Malte Meyn

      Malte Meyn - 2018-12-12

      How about countdown? ;)

       
  • Anonymous

    Anonymous - 2018-12-15

    Patch counted down - please push.

     
  • Malte Meyn

    Malte Meyn - 2018-12-15
    • labels: --> Fixed_2_21_0
    • status: Started --> Fixed
    • Patch: push -->
     
  • Malte Meyn

    Malte Meyn - 2018-12-15

    commit 23576463b257bded39a3b69779b6f308a067f19d
    Author: Malte Meyn lilypond@maltemeyn.de
    Date: Sat Dec 8 15:42:47 2018 +0100

    Issue 2575/2: add regtest
    

    commit a1bde204301ab4655b14b9225c04fb32c1268be2
    Author: Malte Meyn lilypond@maltemeyn.de
    Date: Wed Oct 24 18:38:12 2018 +0200

    Issue 2575/1: Ambitus respects staffLineLayoutFunction
    
     
  • Federico Bruni

    Federico Bruni - 2020-05-01
    • status: Fixed --> Verified