]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/midi.scm
Add warning about using \relative with tagged music (3253)
[lilypond.git] / scm / midi.scm
index 5d68d328a6f89f9104bcaa24d4a5606ba12b678b..48079928221212f9fb12e5d26b7ff5769025a179 100644 (file)
@@ -1,8 +1,19 @@
-;;;; midi.scm -- scm midi variables and functions
+;;;; This file is part of LilyPond, the GNU music typesetter.
 ;;;;
-;;;;  source file of the GNU LilyPond music typesetter
+;;;; Copyright (C) 2000--2012 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;;;
-;;;; (c) 2000--2009 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; LilyPond is free software: you can redistribute it and/or modify
+;;;; it under the terms of the GNU General Public License as published by
+;;;; the Free Software Foundation, either version 3 of the License, or
+;;;; (at your option) any later version.
+;;;;
+;;;; LilyPond is distributed in the hope that it will be useful,
+;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;;; GNU General Public License for more details.
+;;;;
+;;;; You should have received a copy of the GNU General Public License
+;;;; along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 
 
 
@@ -12,7 +23,7 @@
 ;; this is broken: we should not ever export variables from Scheme.
 
 ;; define factor of total volume per dynamic marking
-(define-public absolute-volume-alist '())
+(define-session-public absolute-volume-alist '())
 (set! absolute-volume-alist
       (append
        '(
@@ -36,7 +47,7 @@
   (assoc-get s absolute-volume-alist))
 
 ;; define factors of total volume of minimum and maximum volume
-(define-public instrument-equalizer-alist '())
+(define-session-public instrument-equalizer-alist '())
 (set! instrument-equalizer-alist
       (append
        '(
        instrument-names-alist))
 
 (define-public (percussion? instrument)
-  "returns whether the instrument should use midi channel 9"
+  "Return @code{#t} if the instrument should use MIDI channel 9."
 
   (let* ((inst  (symbol->string instrument))
          (entry (assoc-get inst instrument-names-alist)))
     (and entry (>= entry 32768))))
 
 (define-public (midi-program instrument)
-  "returns the program of the instrument"
+  "Return the program of the instrument."
 
   (let* ((inst  (symbol->string instrument))
          (entry (assoc-get inst instrument-names-alist)))
 (define-public dynamic-default-volume 0.71)
 
 (define-public (alterations-in-key pitch-list)
-  "Count number of sharps minus number of flats"
-
-  (* (apply + (map cdr pitch-list)) 2))
+  "Count number of sharps minus number of flats."
 
+  (apply + (map (lambda (p) (round (* (cdr p) 2))) pitch-list)) )
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;