[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: newbie question on scheme functions
From: |
Andrea Rossato |
Subject: |
Re: newbie question on scheme functions |
Date: |
Fri, 31 Dec 2004 11:48:16 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040630 |
Nicolas Sceaux wrote:
Putting the sharp sign should really do it:
#(define-public (note-name->italian-markup pitch)
Thanks Nicolas for your kind attention.
But this does not actually work.
Ideed, when compiling this file:
%%%%%%%%%%%%%%%
\version "2.4.2"
#(define-public (note-name->itamarkup pitch)
"Return Italian pitch markup for PITCH."
(make-line-markup
(list
(make-simple-markup
(vector-ref #("Do" "Re" "Mi" "Fa" "Sol" "La" "Si")
(ly:pitch-notename pitch)))
(accidental->markup (ly:pitch-alteration pitch)))))
notes = \relative c' {
\key c \major
a4
b
c2
\bar "|."
}
mychords = {
\chordmode {
c1
}
}
\score {
<<
\context ChordNames {
\set chordRootNamer = #note-name->itamarkup
\mychords
}
\context Voice \notes
>>
\midi { \tempo 4=182 }
\layout { }
}
%%%%%%%%%%%%%%%%%%
I get:
Interpreting music... Backtrace:
In unknown file:
?: 0* [lilypond-main ("prova.ly")]
In /usr/share/lilypond/2.4.2/scm/lily.scm:
337: 1* (let* ((failed #) (handler #)) (for-each (lambda # #) files) ...)
339: 2* [for-each #<procedure #f (f)> ("prova.ly")]
In /usr/share/guile/1.6/srfi/srfi-1.scm:
652: 3 (if (null? rest) (letrec ((lp #)) (lp list1)) ...)
...
656: 4 (begin (f (car l)) (lp (cdr l)))
657: 5* [#<procedure #f (f)> "prova.ly"]
In /usr/share/lilypond/2.4.2/scm/lily.scm:
341: 6 [catch ly-file-failed #<procedure #f ()> #<procedure #f (key
arg)>]
In unknown file:
?: 7* [#<procedure #f ()>]
In /usr/share/lilypond/2.4.2/scm/lily.scm:
341: 8* [ly:parse-file "prova.ly"]
In /usr/share/lilypond/2.4.2/ly/init.ly:
7: 9* (if (pair? toplevel-scores) (ly:parser-print-book parser #))
8: 10 [ly:parser-print-book #<my_lily_parser > #<Book>]
In unknown file:
?: 11* [ignatzek-chord-names (#<Pitch c' > #<Pitch e' > #<Pitch g'
>) () ...]
?: 12* (letrec (# # # # ...) (let* # #))
In /usr/share/lilypond/2.4.2/scm/chord-ignatzek-names.scm:
236: 13 (let* (# # # # ...) (if exception # #))
...
188: 14 (let* (# # # # ...) (set! base-stuff #) (make-line-markup
base-stuff))
191: 15* [note-name->itamarkup #<Pitch c' >]
In prova.ly:
3: 16 [make-line-markup ...
4: 17* [list (#<procedure simple-markup (layout props str)> "Do") ...
8: 18* (accidental->markup (ly:pitch-alteration pitch))
prova.ly:8:8: In expression (accidental->markup (ly:pitch-alteration
pitch)):
prova.ly:8:8: Unbound variable: accidental->markup
The very same function in chord-name.scm works perfectly.
I'm I missing something?
Thanks.
I wish you all a very happy new year.
Andrea