Menu

#1367 Enhancement: NoteNames context should handle any note names language

Fixed
push
Enhancement
2019-02-23
2010-10-27
Anonymous
No

Originally created by: anonymous
Originally created by: v.villenave
Originally owned by:* v.villenave

As Mats noticed a few years ago, default (Nederlands) note names are hardcoded in the Note_names_engraver: in the following example, the notes are entered in Spanish but printed in Dutch.

http://lists.gnu.org/archive/html/lilypond-user/2007-03/msg00021.html

\version "2.13.37"
\include "espanol.ly"
notes = \relative do' \{ do re mi do \}
\new Staff <<
   \notes
  \context NoteNames \{ \notes \}
<<

It would be more elegant to use the pitchnames variable (just like \displayLilyMusic does) so we could print note names in any language.

--

Valentin Villenave - 2019-02-02

OK, here’s a (I hope) much better patch that not only deals with the Note_name_engraver, but also aims to make all of the note-/pitch-naming functions more consistent and flexible (including in chord names). Included is a regtest showing off the new capabilities offered by this engraver, including quite a few user-settable properties and Scheme functions. (Documentation is not included yet though, as I’d like to first settle on an agreed feature set, property names and general mechanism.)

https://codereview.appspot.com/221710044

1 Attachments

Discussion

<< < 1 2 (Page 2 of 2)
  • Trevor Daniels

    Trevor Daniels - 2015-10-29

    This issue is Blocked, so changing to Patch:waiting, and reverting to Status:Accepted as the author is not registered at SF.

     
  • David Kastrup

    David Kastrup - 2017-02-03
    • labels: Frog, BlockedOn: 1375 --> Frog
    • assigned_to: Valentin Villenave
    • Patch: waiting --> needs_work
     
  • David Kastrup

    David Kastrup - 2017-02-03

    Valentin, you still listening in? Issue 1375 has been given a solution that works at least for internal purposes right now. If you want to give this another try, this might be the missing piece in the last proposal. I have to admit though that I haven't looked at the original patch yet.

    I am juggling the state of this patch accordingly, feel free to correct it to reflect your actual interest/involvement.

     
  • Valentin Villenave

    Great! Thanks for the reminder!
    I’ve been busy on other (indirectly LilyPond-related) things but I’m definitely still around. I’ll have a look at the new structure and update my patch accordingly.

     
    • David Kastrup

      David Kastrup - 2017-02-03

      Great. There is not much useful documentation so far, but just adding another call to ly:register-translator at the bottom of scm/scheme-engravers.scm should likely do the trick.

      I take it that the engraver you wrote does not strictly need to be a Scheme engraver but should have equally well worked as an extension of the existing C++-written engraver? And your reason to do it in Scheme was not technical necessity but personal reasons (which would include not wanting to mess with C++)? Because I don't think a Scheme engraver has more possibilities than a C++ engraver at least regarding this application.

       
  • Valentin Villenave

    OK, here’s a (I hope) much better patch that not only deals with the Note_name_engraver, but also aims to make all of the note-/pitch-naming functions more consistent and flexible (including in chord names). Included is a regtest showing off the new capabilities offered by this engraver, including quite a few user-settable properties and Scheme functions. (Documentation is not included yet though, as I’d like to first settle on an agreed feature set, property names and general mechanism.)

    Please let me know if you think I’m on the right track here:
    https://codereview.appspot.com/221710044/#ps60001

     
  • Valentin Villenave

    Rewrite Note_name_engraver, using more flexible functions and properties

    http://codereview.appspot.com/221710044

     
  • Valentin Villenave

    • status: Accepted --> Started
    • Needs: -->
    • Patch: new --> review
    • Type: --> Enhancement
     
  • Anonymous

    Anonymous - 2019-02-07
    • Patch: review --> countdown
     
  • Anonymous

    Anonymous - 2019-02-07

    Patch on countdown for Feb 10th

     
  • Anonymous

    Anonymous - 2019-02-10

    Patch counted down - please push.

     
  • Valentin Villenave

    Use existing rassoc function (for now).

    http://codereview.appspot.com/221710044

     
  • Anonymous

    Anonymous - 2019-02-12

    Seems to fail make check

    ../regression/note-names-context.ly'

    Processing `./96/lily-8e4f4d10.ly'
    Parsing...
    Renaming input to: `/home/james/lilypond-git/input/regression/note-names-context.ly'
    Interpreting music...Backtrace:
    In /home/james/lilypond-git/build/out/share/lilypond/current/scm/lily.scm:
    1044:  3  (let* ((failed #) (separate-logs #) (ping-log #) ...) (gc) ...)
    1056:  4* [for-each #<procedure #f #> #]
    In unknown file:
       ?:  5* [#<procedure #f (x)> "96/lily-8e4f4d10.ly"]
    In /home/james/lilypond-git/build/out/share/lilypond/current/scm/lily.scm:
    1058:  6* (let* (# # #) (if separate-logs #) (if ping-log #) ...)
    1069:  7* [lilypond-file #<procedure #f (key failed-file)> "96/lily-8e4f4d10.ly"]
    1104:  8  [catch ly-file-failed #<procedure #f ()> #<procedure #f (x . args)>]
    In unknown file:
       ?:  9* [#<procedure #f ()>]
    In /home/james/lilypond-git/build/out/share/lilypond/current/scm/lily.scm:
    1105: 10* [ly:parse-file "96/lily-8e4f4d10.ly"]
    In /home/james/lilypond-git/build/out/share/lilypond/current/ly/init.ly:
      56: 11* (let* ((book-handler #)) (cond (# #) (# #)))
      59: 12  (cond (# #) (# #))
    In /home/james/lilypond-git/build/out/share/lilypond/current/scm/lily-library.scm:
        ...
     247: 13  [ly:book-process-to-systems #<Book> #< Output_def> ...]
    In unknown file:
       ?: 14* [# #]
       ?: 15* [# # #]
       ?: 16* [#<Callback0_wrapper> #<Translator Note_name_engraver >]
       ?: 17* [note-name-strings #<Pitch c' > #<Context NoteNames () >]
    In /home/james/lilypond-git/build/out/share/lilypond/current/scm/translation-functions.scm:
     888: 18* (let* (# # # # ...) (if oct-style # str))
     892: 19* (if (not (null? lang)) (note-name->string pitch (string->symbol lang)) ...)
     894: 20  [note-name->string #<Pitch c' >]
    In /home/james/lilypond-git/build/out/share/lilypond/current/scm/chord-name.scm:
      67: 21  (let* ((pitch-alist #) (result #)) (if result (symbol->string #)))
      71: 22* (rassoc pitch (filter (lambda (p) (eq? # 0)) pitch-alist) ...)
    
    /home/james/lilypond-git/build/out/share/lilypond/current/scm/chord-name.scm:71:18: In expression (rassoc pitch (filter # pitch-alist) ...):
    /home/james/lilypond-git/build/out/share/lilypond/current/scm/chord-name.scm:71:18: Unbound variable: rassoc
    

    ../accidental-single-double.ly

    Renaming input to: `/home/james/lilypond-git/input/regression/accidental-single-double.ly'
    Interpreting music.../home/james/lilypond-git/build/out/share/lilypond/current/scm/chord-name.scm:71:18: In expression (rassoc pitch (filter # pitch-alist) ...):
    /home/james/lilypond-git/build/out/share/lilypond/current/scm/chord-name.scm:71:18: Unbound variable: rassoc
    

    ../page-spacing-nonstaff-lines-between-systems.ly

    Renaming input to: `/home/james/lilypond-git/input/regression/page-spacing-nonstaff-lines-between-systems.ly'
    Interpreting music.../home/james/lilypond-git/build/out/share/lilypond/current/scm/chord-name.scm:71:18: In expression (rassoc pitch (filter # pitch-alist) ...):
    /home/james/lilypond-git/build/out/share/lilypond/current/scm/chord-name.scm:71:18: Unbound variable: rassoc
    
     
  • Valentin Villenave

    Work with markups rather than simple strings.

    http://codereview.appspot.com/221710044

     
  • Valentin Villenave

    Use make_concat_markup (duh.)

    http://codereview.appspot.com/221710044

     
  • Anonymous

    Anonymous - 2019-02-13

    Psses make, make check and a full make doc.

    reg test diffs here:

    https://nc-cluster02.yourownnet.cloud/index.php/s/zCN9mofqBeNYNRK

     
  • Anonymous

    Anonymous - 2019-02-16
    • Patch: review --> countdown
     
  • Anonymous

    Anonymous - 2019-02-16

    Patch on countdown for Feb 19th

     
  • Anonymous

    Anonymous - 2019-02-19
    • Patch: countdown --> push
     
  • Anonymous

    Anonymous - 2019-02-19

    Patch counted down - please push

     
  • Anonymous

    Anonymous - 2019-02-22

    Patch counted down - please push

     
  • Valentin Villenave

    • labels: --> Fixed_2_21_0
    • status: Started --> Fixed
     
<< < 1 2 (Page 2 of 2)