\version "2.18.2" #(define (make-script x) (make-music 'ArticulationEvent 'articulation-type x)) #(define (add-script m x) (case (ly:music-property m 'name) ((NoteEvent) (set! (ly:music-property m 'articulations) (append (ly:music-property m 'articulations) (list (make-script x)))) m) ((EventChord)(set! (ly:music-property m 'elements) (append (ly:music-property m 'elements) (list (make-script x)))) m) (else #f))) #(define (add-staccato m) (add-script m "staccato")) addStacc = #(define-music-function (parser location music) (ly:music?) (map-some-music add-staccato music)) %%% ............................................ #(define (make-script x) (make-music 'ArticulationEvent 'articulation-type x)) #(define (add-script m x) (case (ly:music-property m 'name) ((NoteEvent) (set! (ly:music-property m 'articulations) (append (ly:music-property m 'articulations) (list (make-script x)))) m) ((EventChord)(set! (ly:music-property m 'elements) (append (ly:music-property m 'elements) (list (make-script x)))) m) (else #f))) #(define (add-portato m) (add-script m "portato")) addPortato = #(define-music-function (parser location music) (ly:music?) (map-some-music add-portato music)) \paper { indent = #30 } \score { << \new Staff \with { instrumentName = "defaut" } \relative c'' { g8-.-- a-.-- b-.-- c-.--\downbow d-.-- c-.-- b-.-- a-.--\upbow } \new Staff \with { instrumentName = "+ \addStacc" } \relative c' { \addStacc { g'8 a b c\downbow d c b a\upbow } } \new Staff \with { instrumentName = "+ \addPortato" } \relative c' { \addPortato { g'8 a b c\downbow d c b a\upbow } } \new Staff \with { instrumentName = "+ \addP + \ov." } \relative c' { \override Staff.Script.padding = #0 \override Staff.Script.toward-stem-shift = ##t \override Staff.Script.quantize-position = ##t \addPortato { g'8 a b c\downbow d c b a\upbow } } >> }