[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Triplets
From: |
Thomas Morley |
Subject: |
Re: Triplets |
Date: |
Sun, 15 Jan 2017 16:30:58 +0100 |
2017-01-15 0:21 GMT+01:00 Thomas Morley <address@hidden>:
> With my lily-2.14.2 I can do in terminal:
>
> ~$ lilypond-2-14-2 -e '(scm-style-repl)'
> GNU LilyPond 2.14.2
> guile> UP
> 1
> guile> DOWN
> -1
> guile> ly:tuplet-bracket::calc-direction
> #<primitive-procedure ly:tuplet-bracket::calc-direction>
> guile>
>
> All there and available...
>
> Cheers,
> Harm
Below you find a working code tested with 2.14.2!
Not sure the output is always convincing, though...
I'm _very_ happy this version is antique, coding there is aarrgh.
\version "2.14.2"
\score {
\new Staff
\relative c''{
\times 2/3 { c4 d e }
\voiceOne
\times 2/3 { a,4 b c }
\times 2/3 { a4 b c' }
\times 2/3 { a,4 b c, }
\times 2/3 { a'4 b, c }
\voiceTwo
\times 2/3 { a'4 b c }
\times 2/3 { a4 b c' }
\times 2/3 { a,4 b c, }
\times 2/3 { a'4 b, c }
}
\layout {
\context {
\Voice
%% Use 'thickness from Slur
\override TupletBracket #'thickness = #1.2
%% 'control-points need to be set
\override TupletBracket #'after-line-breaking =
#(lambda (grob)
(let* ((x-pos (ly:stencil-extent (ly:grob-property grob 'stencil) X))
(pos (ly:grob-property grob 'positions))
(x-ln (interval-length x-pos))
(dir (ly:grob-property grob 'direction))
;;; read out the height of the TupletBracket, maybe negative!
(height (- (cdr pos) (car pos)))
;;; height-corr is introduced because sometimes the shape of
;;; the slur needs to be adjusted.
;;; It is used in the 2nd/3rd control-point.
;;; The value of 0.3 is found by trial and error
(height-corr (* 0.3 dir height))
(edge-height (ly:grob-property grob 'edge-height '(0.7 . 0.7)))
(pad 1.0))
;; set control-points for slur-stencil
(ly:grob-set-property! grob 'control-points
(list
;; first cp
(cons
(+ (car x-pos) 0.5)
(- (+ (* dir pad) (+ (car pos) (* -1 dir (car edge-height))))
(* 0.5 dir)))
;; second cp
(cons
(+ (car x-pos) (* x-ln 1/4))
(+ (* dir pad) (+ (car pos) (* dir (+ 0.7 height-corr)))))
;; third cp
(cons
(+ (car x-pos) (* x-ln 3/4))
(+ (* dir pad) (+ (cdr pos) (* dir (- 0.7 height-corr)))))
;; fourth cp
(cons
(- (cdr x-pos) 0.5)
(- (+ (* dir pad) (+ (cdr pos) (* -1 dir (cdr edge-height))))
(* 0.5 dir)))))
;; Use slur-stencil
(ly:grob-set-property! grob 'stencil
;; For debugging uncomment the following three lines
;; and comment (ly:slur::print grob)
;(ly:stencil-add
; (ly:grob-property grob 'stencil)
; (ly:slur::print grob))
(ly:slur::print grob)
)))
\override TupletBracket #'staff-padding = #'()
%% probably:
%\override TupletBracket #'direction =
% #(lambda (grob)
% (if (eq? UP (ly:tuplet-bracket::calc-direction grob)) DOWN UP))
}
}
}
Cheers,
Harm
- Re: Triplets, (continued)
- Re: Triplets, J Martin Rushton, 2017/01/14
- Re: Triplets, Richard Shann, 2017/01/14
- Re: Triplets, J Martin Rushton, 2017/01/14
- Re: Triplets, Richard Shann, 2017/01/14
- Re: Triplets, Hans Aikema, 2017/01/14
- Re: Triplets, J Martin Rushton, 2017/01/14
- Re: Triplets, Hans Aikema, 2017/01/14
- Re: Triplets, Hans Aikema, 2017/01/14
- Re: Triplets, J Martin Rushton, 2017/01/14
- Re: Triplets, Thomas Morley, 2017/01/14
- Re: Triplets,
Thomas Morley <=
- Re: Triplets, Simon Albrecht, 2017/01/14
- Re: Triplets, Hans Aikema, 2017/01/14
- Re: Triplets, Noeck, 2017/01/15
- Re: Triplets, J Martin Rushton, 2017/01/14