[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lilypond-user
Subject:    Re: Scheme question
From:       Muzhic <imj-muzhic () bluewin ! ch>
Date:       2018-12-26 16:44:33
Message-ID: 1D41A51E-BE2C-4ED6-A59D-B15661FA8C2A () bluewin ! ch
[Download RAW message or body]

Thanks a lot, Harm, and a happy musical year to everybody!

Envoyé de mon iPhone

> Le 26 déc. 2018 à 00:13, Thomas Morley <thomasmorley65@gmail.com> a écrit :
> 
> > Am Di., 25. Dez. 2018 um 21:19 Uhr schrieb Jacques Menu <imj-muzhic@bluewin.ch>:
> > 
> > Hello folks,
> > 
> > I don't succeed in using ‘#:concat' to compute the second argument to \
> > ‘#(:note' in the following Scheme code, where HERE occurs. 
> > What should I use instead? The aim is to use half the value of ‘den' instead of \
> > 4 in the previous line. 
> > Thanks for your help!
> > 
> > JM
> > 
> > --
> > 
> > 
> > #(define-public (format-time-sig-dotted-note-horizontally grob)
> > (let* ((frac (ly:grob-property grob 'fraction))
> > (num (if (pair? frac) (car frac) 4))
> > (den (if (pair? frac) (cdr frac) 4))
> > (m (markup #:override '(baseline-skip . 0.5)
> > #:line (#:number (number->string (/ num 3))
> > #'"/"
> > #:override '(style . default)
> > #:raise 0.6 (#:note (number->string den) UP)
> > 
> > #:raise 0.6 (#:note #'"4." UP)
> > #:raise 0.6 (#:note (#:concat #'"4" #'".") UP) ;; HERE
> > )
> > )
> > )
> > )
> > (grob-interpret-markup grob m)))
> > 
> > Starting lilypond 2.19.82 [NotesInTimeSignatureExample.ly]...
> > Processing `/Users/menu/Documents/LaTeX/PartitionsLilypond/NotesInTimeSignatureExample.ly'
> >  Parsing...
> > Interpreting music...[8]
> > Preprocessing graphical \
> > objects.../Applications/LilyPond.app/Contents/Resources/share/lilypond/current/scm/markup-macros.scm:368:18: \
> > In procedure car in expression (car expr): \
> > /Applications/LilyPond.app/Contents/Resources/share/lilypond/current/scm/markup-macros.scm:368:18: \
> > Wrong type (expecting pair): "4" Exited with return code 1.
> 
> Hi,
> 
> in scheme-syntax don't prepend strings with a #-sign:
> $(markup (#:note "4." UP))
> 
> concat-markup expects a markup-list, thus place parens correctly:
> $(markup (#:concat ("4" ".")))
> 
> Though, note-markup expects a string (in 2.19.82), thus below does not
> work, but the error-message is helpful:
> $(markup (#:note (#:concat ("4" ".")) UP))
> ->
> fatal error: make-note-markup: Invalid argument in position 1.
> Expect: string, found: (#<procedure concat-markup (layout props args)>
> ((#<procedure simple-markup (layout props str)> "4") (#<procedure
> simple-markup (layout props str)> "."))).
> 
> You need to create a simple string, here some methods:
> $(markup (#:note (string-concatenate '("4" ".")) UP))
> $(markup (#:note (string-append "4" ".") UP))
> $(markup (#:note (format #f "~a~a" "4" ".") UP))
> $(markup (#:note (format #f "~a." "4") UP))
> $(markup (#:note (format #f "~a." 4) UP))
> 
> 
> HTH,
> Harm


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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic