[fomus-cvs] CVS update: fomus/backend_ly.lisp fomus/backend_mid.lisp fomus/fomus.asd fomus/version.lisp

David Psenicka dpsenicka at common-lisp.net
Thu Oct 6 02:27:20 UTC 2005


Update of /project/fomus/cvsroot/fomus
In directory common-lisp.net:/tmp/cvs-serv23599

Modified Files:
	backend_ly.lisp backend_mid.lisp fomus.asd version.lisp 
Log Message:
bug fixes
Date: Thu Oct  6 04:27:16 2005
Author: dpsenicka

Index: fomus/backend_ly.lisp
diff -u fomus/backend_ly.lisp:1.18 fomus/backend_ly.lisp:1.19
--- fomus/backend_ly.lisp:1.18	Wed Oct  5 16:27:36 2005
+++ fomus/backend_ly.lisp	Thu Oct  6 04:27:12 2005
@@ -59,6 +59,20 @@
 	    (er "compiling")))
       #-(and (or cmu sbcl openmcl) (or linux darwin unix)) (format t ";; ERROR: Don't know how to compile/view lilypond file~%"))))
 
+(defparameter *lilypond-version* t)
+(defun lilypond-version (options)
+  (if (truep *lilypond-version*)
+      (setf *lilypond-version*
+	    (destructuring-bind (&key exe &allow-other-keys) options
+	      (let ((os (make-string-output-stream)))
+		(ignore-errors (#+cmu extensions:run-program #+sbcl sb-ext:run-program #+openmcl ccl:run-program (or exe +lilypond-exe+)
+				      (list "-v") :wait t :output os))
+		(let* ((out (get-output-stream-string os))
+		       (p (search "LilyPond " out)))
+		  (when p (multiple-value-bind (n1 np) (parse-integer out :start (+ p 9) :junk-allowed t)
+			    (+ (* n1 100) (parse-integer out :start (1+ np) :junk-allowed t))))))))
+      *lilypond-version*))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; LILYPOND BACKEND
 
@@ -69,13 +83,21 @@
 (defparameter +lilypond-defs+
   '("octUp = #(set-octavation 1)"
     "octReset = #(set-octavation 0)"
-    "octDown = #(set-octavation -1)" 
-    "beamL = #(def-music-function (loc num) (number?) #{\\set stemLeftBeamCount = #$num #})"
+    "octDown = #(set-octavation -1)"))
+(defparameter +lilypond-defs-24+
+  '("beamL = #(def-music-function (loc num) (number?) #{\\set stemLeftBeamCount = #$num #})"
     "beamR = #(def-music-function (loc num) (number?) #{\\set stemRightBeamCount = #$num #})"
     "beamLR = #(def-music-function (loc numl numr) (number? number?) #{\\set stemLeftBeamCount = #$numl \\set stemRightBeamCount = #$numr #})" 
     "textSpan = #(def-music-function (loc dir str) (number? string?) #{\\override TextSpanner #'direction = #$dir \\override TextSpanner #'edge-text = #(cons $str \"\") #})" 
     "noteHead = #(def-music-function (loc sty) (symbol?) #{\\once \\override NoteHead #'style = #$sty #})"
     ))
+(defparameter +lilypond-defs-26+
+  '("beamL = #(def-music-function (par loc num) (number?) #{\\set stemLeftBeamCount = #$num #})"
+    "beamR = #(def-music-function (par loc num) (number?) #{\\set stemRightBeamCount = #$num #})"
+    "beamLR = #(def-music-function (par loc numl numr) (number? number?) #{\\set stemLeftBeamCount = #$numl \\set stemRightBeamCount = #$numr #})" 
+    "textSpan = #(def-music-function (par loc dir str) (number? string?) #{\\override TextSpanner #'direction = #$dir \\override TextSpanner #'edge-text = #(cons $str \"\") #})" 
+    "noteHead = #(def-music-function (par loc sty) (symbol?) #{\\once \\override NoteHead #'style = #$sty #})"
+    ))
 
 (defparameter +lilypond-num-note+ (vector "c" nil "d" nil "e" "f" nil "g" nil "a" nil "b"))
 (defparameter +lilypond-num-acc+ (vector "eses" "es" "" "is" "isis"))
@@ -140,7 +162,8 @@
       (format f "~A" header)
       (loop for e in +lilypond-head+ do (format f "~A~%" e) finally (format f "~%")) ;; stuff at top
       (when filehead (loop for e in (force-list filehead) do (format f "~A~%" e) finally (format f "~%"))) ;; user header
-      (loop for e in +lilypond-defs+ do (format f "~A~%" e) finally (format f "~%")) ;; definitions
+      (loop for e in (append +lilypond-defs+ (if (>= (lilypond-version options) 205) +lilypond-defs-26+ +lilypond-defs-24+))
+	    do (format f "~A~%" e) finally (format f "~%")) ;; definitions
       (let ((de 0) (nms nil) (twrn nil))
 	(flet ((lynote (wnum acc1 acc2 caut)
 		 (if *quartertones*


Index: fomus/backend_mid.lisp
diff -u fomus/backend_mid.lisp:1.4 fomus/backend_mid.lisp:1.5
--- fomus/backend_mid.lisp:1.4	Wed Oct  5 16:27:36 2005
+++ fomus/backend_mid.lisp	Thu Oct  6 04:27:12 2005
@@ -339,7 +339,7 @@
 												  (if di (>= (event-grace e) 0) (< (event-grace e) 0)))
 											  collect (if cd (cons (if di (incf co cd) (decf co cd)) cd)
 												      (progn
-													(setf cd (loop for (x . rr) on r
+													(setf cd (loop for x in r
 														       for su from 1
 														       while (and (event-grace x)
 																  (= (event-off x) (event-off e)))
@@ -373,9 +373,9 @@
 										      (loop with n0 = (if (chordp ev) (event-notes* ev) (list (event-note* ev)))
 											    with ln = (length n0)
 											    and cch = (or (when pizz (lookup pizzch aps))
-													  (loop for v in '(stopped open flageolet harmonic)
+													  (loop for v in '(:stopped :open :flageolet :harmonic)
 														and c in (list stoppedch opench flageoletch harmonicch)
-														for m = (getmark ev c)
+														for m = (getmark ev v)
 														when m do (return (lookup c aps)))
 													  ch)
 											    for n in n0 and x from 1


Index: fomus/fomus.asd
diff -u fomus/fomus.asd:1.14 fomus/fomus.asd:1.15
--- fomus/fomus.asd:1.14	Wed Oct  5 16:27:36 2005
+++ fomus/fomus.asd	Thu Oct  6 04:27:12 2005
@@ -4,7 +4,7 @@
 (asdf:defsystem "fomus"
   
   :description "Lisp music notation formatter"
-  :version "0.1.18"
+  :version "0.1.19"
   :author "David Psenicka"
   :licence "LLGPL"
 


Index: fomus/version.lisp
diff -u fomus/version.lisp:1.13 fomus/version.lisp:1.14
--- fomus/version.lisp:1.13	Wed Oct  5 16:27:36 2005
+++ fomus/version.lisp	Thu Oct  6 04:27:12 2005
@@ -12,7 +12,7 @@
 (declaim (type string +title+)
 	 (type cons +version+ +banner+))
 (defparameter +title+ "FOMUS")
-(defparameter +version+ '(0 1 18))
+(defparameter +version+ '(0 1 19))
 (defparameter +banner+
   `("Lisp music notation formatter"
     "Copyright (c) 2005 David Psenicka, All Rights Reserved"




More information about the Fomus-cvs mailing list