|
From: | Jacques Menu |
Subject: | Re: Visualisation graphique de la musique |
Date: | Sat, 23 Jan 2021 12:11:55 +0100 |
Bonjour Michel, Je n’ai pas noté (…) qui a proposé ça dans ce genre. En épaissisant les traits? \version "2.16.0" %% Works with 2.17.6 %% Works with 2.18.0 %% Works with 2.19.1 #(define (flat-gliss value) (lambda (grob) (let* ((left-Y (assoc-get 'Y (ly:grob-property grob 'left-bound-info))) (stencil (ly:line-spanner::print grob)) (stencil-x-ext (ly:stencil-extent stencil X)) (line-thickness (ly:staff-symbol-line-thickness grob)) (staff-space (ly:staff-symbol-staff-space grob)) (half-gliss-thick (- (/ staff-space 2) line-thickness)) (bound-left (ly:spanner-bound grob LEFT)) (bound-right (ly:spanner-bound grob RIGHT)) (grob-name (lambda (x) (assq-ref (ly:grob-property x 'meta) 'name))) (note-head? (lambda (x) (eq? (grob-name x) 'NoteHead))) (staff-pos-left (if (note-head? bound-left) (ly:grob-property bound-left 'staff-position) 0)) (staff-pos-right (if (note-head? bound-right) (ly:grob-property bound-right 'staff-position) 0)) (x-corr (lambda (x) (if (>= (abs x) 6) line-thickness 0))) (new-stencil (ly:round-filled-box (let ((x-corr-left (x-corr staff-pos-left)) (x-corr-right (* -4 (x-corr staff-pos-right)))) (cons (+ x-corr-left (car stencil-x-ext)) (+ x-corr-right (cdr stencil-x-ext) (* line-thickness 3)))) (interval-widen (cons left-Y left-Y) (- half-gliss-thick value)) 0.1))) (ly:grob-set-nested-property! grob '(right-bound-info Y) left-Y) new-stencil))) flatGliss = #(define-music-function (parser location glissando-stubs? val) ((boolean? #t) number?) #{ #(if glissando-stubs? #{ \override Glissando #'after-line-breaking = ##t #} #{ \revert Glissando #'after-line-breaking #}) \override Glissando #'stencil = #(flat-gliss val) \override Glissando #'breakable = ##t #}) %%%%%%%%%%%%%%%%%% %% EXAMPLE %%%%%%%%%%%%%%%%%% _one_ = \relative c' { b1 \glissando %% Works, because a spacer-rest doesn't define a NoteColumn s1*9 \once \hideNotes b1 <e' d >1 \glissando \break s1*8 \break <e d> } two = \relative c' { s1 f1 \glissando s1*6 \once \hideNotes b1 } three = \relative c' { s1*2 d'1 \glissando s1*4 \once \hideNotes d1 } four = \relative c' { s1*3 as''1 \glissando s1*2 \break a!4\glissando b \glissando c2 \glissando s1*2 \revert Glissando #'stencil \override Glissando #'thickness = #3 d1 \glissando s2.. f,1 } \score { \new Staff << \new Voice \one \new Voice \two \new Voice \three \new Voice \four >> \layout { \context { \Voice %% Increasing the number will result %% in a more narrow line. %% Warning: if it is increased > 0.4 %% a warning will appear and no line is printed! \flatGliss #0.23 \override NoteHead #'duration-log = #2 \override Stem #'stencil = ##f } \context { \Staff \remove "Time_signature_engraver" } \context { \Score defaultBarType = #"empty" } } }
|
[Prev in Thread] | Current Thread | [Next in Thread] |