Dan Eble <[email protected]> writes: > [I dropped lilypond-devel when I replied. Sending David’s reply to the list.] > > From: David Kastrup <[email protected]> > Subject: Re: Custom accidental styles > Date: May 21, 2016 at 12:29:05 EDT > To: Dan Eble <[email protected]> > > Dan Eble <[email protected]> writes: > >>> On May 21, 2016, at 11:00 , David Kastrup <[email protected]> wrote: >>> >>> Dan Eble <[email protected]> writes: >>> >>>> On May 20, 2016, at 05:38 , Simon Albrecht <[email protected]> wrote: >>>>> I was hoping to do further improvements to the code (comments and >>>>> simplification) such as to make the threshold still lower, but I >>>>> didn’t get there unfortunately. >>>>> >>>>> HTH, Simon >>>>> <accidental-style-baroque.ily> >>>> >>>> Thank you. That was helpful. This worked for me: >>>> >>>> %% Like voice, with additional cautionary cross-voice cancellations >>>> #(set! accidental-styles (append accidental-styles >>>> `((hymnbook-cautionary #f >>>> (Voice ,(make-accidental-rule 'same-octave 0)) >>>> (Staff ,(make-accidental-rule 'same-octave 0)) >>>> Staff)))) >>> >>> accidental-styles.hymnbook-cautionary = >>> #`(#f (Voice ,(make-accidental-rule 'same-octave 0)) >>> (Staff ,(make-accidental-rule 'same-octave 0)) >>> Staff) >> >> It’s prettier, but it isn’t working. With 2.19.42, I get "warning: >> unknown accidental style” and the style is not put into effect. The >> attached file demonstrates both ways. > > Ugh. Wouldn't work with define! instead of set! either I guess (which > is what lily-lexer.cc uses effectively). The variable is defined in a > different module (lily rather than the current lexer). > > From the Guile docs: > > `define' (when it occurs at top level), `scm_define' and > `scm_c_define' all create or set the value of a variable in the top > level environment of the current module. If there was not already a > variable with the specified name belonging to the current module, but a > similarly named variable from another module was visible through having > been imported, the newly created variable in the current module will > shadow the imported variable, such that the imported variable is no > longer visible. > > So for > > xxx.yyy = ... > > we quite likely want set! semantics. How about for > > xxx = ... > > ?
Ugh. GNU LilyPond 2.19.43 Processing `input/regression/collision-2.ly' Parsing.../usr/local/tmp/lilypond/out/share/lilypond/current/scm/lily-library.scm:583:32: In expression (break pred lst): /usr/local/tmp/lilypond/out/share/lilypond/current/scm/lily-library.scm:583:32: Wrong type to apply: #<Prob: Music C++: Music((origin . #<location /usr/local/tmp/lilypond/out/share/lilypond/current/ly/declarations-init.ly:64:9>) (break-permission . force))((display-methods #<procedure #f (expr)>) (name . LineBreakEvent) (types line-break-event break-event event)) > `break' is a procedure (automatically loaded) in (srfi srfi-1). It is also a music expression in ly/declarations-init.ly. Overwriting it does not seem like a good idea... -- David Kastrup _______________________________________________ lilypond-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/lilypond-devel
