-(use-modules (ice-9 regex))
+(use-modules (ice-9 regex)
+ (srfi srfi-1))
+
+
+;; should make module?
+
"
(define (dump-duration d port)
(display (open-tag 'duration
- `((log . ,(duration-log d))
- (dots . ,(duration-dot-count d))
- (numer . ,(car (duration-factor d)))
- (denom . ,(cdr (duration-factor d)))
+ `((log . ,(ly:duration-log d))
+ (dots . ,(ly:duration-dot-count d))
+ (numer . ,(car (ly:duration-factor d)))
+ (denom . ,(cdr (ly:duration-factor d)))
)
'() ) port)
(display (close-tag 'duration) port))
(define (dump-pitch p port)
(display (open-tag 'pitch
- `((octave . ,(pitch-octave p))
- (notename . ,(pitch-notename p))
- (alteration . ,(pitch-alteration p))
+ `((octave . ,(ly:pitch-octave p))
+ (notename . ,(ly:pitch-notename p))
+ (alteration . ,(ly:pitch-alteration p))
)
'() ) port)
(display (close-tag 'pitch) port))
"\n "
(symbol->string sym)
"=\""
-
(let ((s (call-with-output-string (lambda (port) (display val port)))))
(re-sub-alist s xml-entities-alist))
-
"\""
)))
(string-append
"<" (symbol->string tag)
(apply string-append
- (map dump-attr (filter-list candidate? attrs)))
-
+ (map dump-attr (filter candidate? attrs)))
">\n")
)
(define (music-to-xml-helper music port)
(let*
(
- (name (ly-get-mus-property music 'name))
- (e (ly-get-mus-property music 'element))
- (es (ly-get-mus-property music 'elements))
- (mprops (ly-get-mutable-properties music))
- (p (ly-get-mus-property music 'pitch))
- (d (ly-get-mus-property music 'duration))
+ (name (ly:get-mus-property music 'name))
+ (e (ly:get-mus-property music 'element))
+ (es (ly:get-mus-property music 'elements))
+ (mprops (ly:get-mutable-properties music))
+ (p (ly:get-mus-property music 'pitch))
+ (d (ly:get-mus-property music 'duration))
(ignore-props '(origin elements duration pitch element))
)
(display (open-tag 'music (cons `(type . ,name) mprops) ignore-props)
port)
- (if (duration? d)
+ (if (ly:duration? d)
(dump-duration d port))
- (if (pitch? p)
+ (if (ly:pitch? p)
(dump-pitch p port))
(if (pair? es)
(map (lambda (x) (music-to-xml-helper x port)) es)
)
- (if (music? e)
+ (if (ly:music? e)
(begin
(music-to-xml-helper e port)))
(display (close-tag 'music) port)
- ))
-
-
+ ))
+
(define-public (music-to-xml music port)
"Dump XML-ish stuff to PORT."
- (display (dtd-header) port)
+
+ ;; dtd contains # -- This confuses tex during make web.
+ ;;
+ ;; (display (dtd-header) port)
+
(display (open-tag 'music '((type . score)) '()) port)
(music-to-xml-helper music port)
(display (close-tag 'music) port))