Function: math-spn-to-midi

math-spn-to-midi is a byte-compiled function defined in calc-units.el.gz.

Signature

(math-spn-to-midi SPN)

Documentation

Return the MIDI number corresponding to SPN.

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calc-units.el.gz
(defun math-spn-to-midi (spn)
  "Return the MIDI number corresponding to SPN."
  (let* ((note (cdr (assoc (nth 1 (car spn)) math-notes)))
         (octave (math-add (nth 2 (car spn)) 1))
         (cents (nth 1 spn))
         (midi  (math-add
                 (math-mul 12 octave)
                 note)))
    (if cents
        (math-add midi (math-div cents 100))
      midi)))