|
From: | address@hidden |
Subject: | Re: ottavation |
Date: | Wed, 6 Apr 2011 14:34:20 -0400 |
On Apr 6, 2011, at 9:26 AM, Peter O'Doherty wrote:
Kinda kludgy, but it works! Automating this type of truncating can likely become part of LilyPond for 2.15/2.16. In the meantime, this should do the trick. #(define (make-ottava-set-short music) (let ((octavation (ly:music-property music 'ottava-number))) (list (context-spec-music (make-apply-context (lambda (context) (let ((offset (* -7 octavation)) (string (assoc-get octavation '((2 . "15") (1 . "8") (0 . #f) (-1 . "8") (-2 . "15"))))) (set! (ly:context-property context 'middleCOffset) offset) (set! (ly:context-property context 'ottavation) string) (ly:set-middle-C! context)))) 'Staff)))) shortOttava = #(define-music-function (parser location octave) (integer?) (make-music 'OttavaMusic 'ottava-number octave 'elements-callback make-ottava-set-short)) \score { \new Staff { \relative c'' { \shortOttava #1 a b c d \shortOttava #0 a b c d }}} |
[Prev in Thread] | Current Thread | [Next in Thread] |