[prev in list] [next in list] [prev in thread] [next in thread]
List: lilypond-user
Subject: Force minor trill playback
From: Gilberto Agostinho <gilbertohasnofb () gmail ! com>
Date: 2015-11-30 12:14:56
Message-ID: 1448885696302-184281.post () n5 ! nabble ! com
[Download RAW message or body]
Hi all,
In case someone else will find this useful, here is a way to force all
trills to be minor:
\include "articulate.ly"
\version "2.19.28"
#(define (ac:trill music)
(let* ((hemisemidur (ly:make-duration 5 0 1/1))
(orig-len (ly:music-length music))
(t (ac:twiddletime music))
(uppernote '())
(note_moment (ly:moment-mul t (ly:make-moment 1/2)))
(c1 (ly:moment-div orig-len t))
(c2 (inexact->exact
(round (/ (ly:moment-main-numerator c1)
(* 2 (ly:moment-main-denominator c1))))))
(count (if (< c2 2) 2 c2)))
(set! (ly:music-property music 'elements)
(filter (lambda (y) (eq? 'NoteEvent (ly:music-property y 'name)))
(ly:music-property music 'elements)))
(map (lambda (y) (ac:setduration y hemisemidur))
(ly:music-property music 'elements))
(set! uppernote (ly:music-transpose (ly:music-deep-copy music)
(ly:make-pitch 0 0 SHARP)))
(let* ((trillMusicElements
(let loop ((so_far (list uppernote music))
(c count))
(if (> c 1)
(loop (append (list (ly:music-deep-copy uppernote)
(ly:music-deep-copy music)) so_far) (1- c))
so_far)))
(trillMusic (make-sequential-music trillMusicElements))
(newlen (ly:music-length trillMusic))
(factor (ly:moment-div orig-len newlen)))
(ly:music-compress trillMusic factor)
)))
music = { \time 2/4 c'4\startTrillSpan d' e' fis'}
\score {
\unfoldRepeats \new Staff \articulate \music
\midi {}
}
Cheers,
Gilberto
--
View this message in context: \
http://lilypond.1069038.n5.nabble.com/Force-minor-trill-playback-tp184281.html Sent \
from the User mailing list archive at Nabble.com.
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic