Philippe Hezaine a écrit :
miquel parera a écrit :
Hello.

I want translate the dynamics of one note (\pppp, \ff etc) to midi velocity values (0-127) I'ts possible?

Thanks.

Look at midi.scm in /usr/share/Lilypond
HTH.

...or put this in a .ly file and call it with an \include (Thanks to
Nicolas Sceaux):

#(define my-dynamic-absolute-volume
   (let ((absolute-volume-alist '(("sf" . 1.00)
                                  ("fffff" . 0.95)
                                  ("ffff" . 0.91)
                                  ("fff" . 0.83)
                                  ("ff" . 0.75)
                                  ("f" . 0.67)
                                  ("mf" . 0.60)
                                  ("mp" . 0.53)
                                  ("p" . 0.46)
                                  ("pp" . 0.39)
                                  ("ppp" . 0.32)
                                  ("pppp" . 0.25)
                                  ("ppppp" . 0.12))))
     (lambda (s)
       (let ((entry (assoc s absolute-volume-alist)))
         (if entry
             (cdr entry))))))

You have to add a \context in midi block in your .ly file like this:

  \midi {
    \context {
      \Score
       dynamicAbsoluteVolumeFunction = #my-dynamic-absolute-volume
         }
    }

Notice the values are scm values.
Have fun.
--
  Phil.




_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to