]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/lily.scm
* scm/output-lib.scm (note-head-style->attachment-coordinates):
[lilypond.git] / scm / lily.scm
index 5118e581100ddd6e51cfc7cea98d62ca87954b59..9ceb5333ed322b51231d33c066404b21a5db8127 100644 (file)
 ;;; have a more sensible default.
 
 
-
-(debug-enable 'debug)
-;(debug-enable 'backtrace)
-(read-enable 'positions)
+(if (ly:get-option 'verbose)
+    (begin
+      (debug-enable 'debug)
+      (debug-enable 'backtrace)
+      (read-enable 'positions)))
 
 
 (define-public (line-column-location line col file)
 (define-public DOWN -1)
 (define-public CENTER 0)
 
+(define-public DOUBLE-FLAT -4)
+(define-public THREE-Q-FLAT -3)
+(define-public FLAT -2)
+(define-public SEMI-FLAT -1)
+(define-public NATURAL 0)
+(define-public SEMI-SHARP 1)
+(define-public SHARP 2)
+(define-public THREE-Q-SHARP 3)
+(define-public DOUBLE-SHARP 4)
+(define-public SEMI-TONE 2)
+
+(define-public ZERO-MOMENT (ly:make-moment 0 1)) 
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; lily specific variables.
 (define-public default-script-alist '())
            handle
            (chain-assoc x (cdr alist-list))))))
 
+(define (chain-assoc-get x alist-list default)
+  (if (null? alist-list)
+      default
+      (let* ((handle (assoc x (car alist-list))))
+       (if (pair? handle)
+           (cdr handle)
+           (chain-assoc-get x (cdr alist-list) default)))))
+
 
 (define (map-alist-vals func list)
   "map FUNC over the vals of  LIST, leaving the keys."
@@ -232,10 +254,15 @@ L1 is copied, L2 not.
   (remainder (+ a 1) 2))
   
 
-(define-public (widen-interval iv amount)
+(define-public (interval-widen iv amount)
    (cons (- (car iv) amount)
-         (+ (cdr iv) amount))
-)
+         (+ (cdr iv) amount)))
+
+
+(define-public (interval-union i1 i2)
+   (cons (min (car i1) (car i2))
+        (max (cdr i1) (cdr i2))))
+
 
 (define-public (write-me message x)
   "Return X.  Display MESSAGE and write X.  Handy for debugging, possibly turned off."
@@ -276,7 +303,7 @@ L1 is copied, L2 not.
         (fn (%search-load-path x))
 
         )
-    (if (ly:verbose)
+    (if (ly:get-option 'verbose)
        (format (current-error-port) "[~A]" fn))
     (primitive-load fn)))