Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OrchestralLily
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Edition Kainhofer
OrchestralLily
Commits
1536c55c
Commit
1536c55c
authored
12 years ago
by
Reinhold Kainhofer
Browse files
Options
Downloads
Patches
Plain Diff
Add make-attr-dynamic-script to create dynamics with text before/after the dynamic
parent
46dd70d1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
orchestrallily.ily
+66
-21
66 additions, 21 deletions
orchestrallily.ily
with
66 additions
and
21 deletions
orchestrallily.ily
+
66
−
21
View file @
1536c55c
...
@@ -1104,33 +1104,72 @@ hairpinOffset = #(define-music-function (parser location posY) (number?)
...
@@ -1104,33 +1104,72 @@ hairpinOffset = #(define-music-function (parser location posY) (number?)
\once \override DynamicLineSpanner #'Y-extent = #(cons +0 -0.01)
\once \override DynamicLineSpanner #'Y-extent = #(cons +0 -0.01)
#})
#})
#(define ((line-break-offset before after) grob)
% #(define ((line-break-offset before after) grob)
(let* ((orig (ly:grob-original grob))
% (let* ((orig (ly:grob-original grob))
; All siblings if line-broken:
% ; All siblings if line-broken:
(siblings (if (ly:grob? orig) (ly:spanner-broken-into orig) '() )))
% (siblings (if (ly:grob? orig) (ly:spanner-broken-into orig) '() )))
(if (>= (length siblings) 2)
% (if (>= (length siblings) 2)
; We have been line-broken
% ; We have been line-broken
(if (eq? (car (last-pair siblings)) grob)
% (if (eq? (car (last-pair siblings)) grob)
; Last sibling:
% ; Last sibling:
(ly:grob-set-property! grob 'Y-offset after)
% (ly:grob-set-property! grob 'Y-offset after)
; Others get the before value:
% ; Others get the before value:
(ly:grob-set-property! grob 'Y-offset before)
% (ly:grob-set-property! grob 'Y-offset before)
)
% )
)
% )
)
% )
)
% )
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Custom dynamic commands (with optional text before/after the dynamic)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% calculate x-alignment based on attribute text + dynamic text
% this has to be a markup-command to get stencil-extent based on (interpret-markup layout props ...)
#(define-markup-command (center-dyn layout props pre-text dyn post-text)(markup? string? markup?)
"x-align on center of dynamic with pre- and post-texts"
(let* (
(pre-stencil (interpret-markup layout props (markup #:normal-text #:italic pre-text )))
(post-stencil (interpret-markup layout props (markup #:normal-text #:italic post-text)))
(dyn-stencil (interpret-markup layout props (markup #:dynamic dyn)))
(pre-x (interval-length (ly:stencil-extent pre-stencil X)))
(dyn-x (interval-length (ly:stencil-extent dyn-stencil X)))
(post-x (interval-length (ly:stencil-extent post-stencil X)))
(x-align
(* (-
(/ (+ pre-x (/ dyn-x 2)) (+ pre-x dyn-x post-x) )
0.5) 2)
)
)
(interpret-markup layout props (markup #:halign x-align #:line (#:normal-text #:italic pre-text #:dynamic dyn #:normal-text #:italic post-text)))
))
% define a 'new' attributed dynamic script
#(define (make-attr-dynamic-script pre dyn post)
(let ((dynamic (make-dynamic-script (markup #:center-dyn pre dyn post))))
(ly:music-set-property! dynamic 'tweaks (acons 'X-offset 0 (ly:music-property dynamic 'tweaks)))
dynamic))
#(define (make-whiteout-attr-dynamic-script pre dyn post)
(let ((dynamic (make-dynamic-script (markup #:whiteout #:center-dyn pre dyn post))))
(ly:music-set-property! dynamic 'tweaks (acons 'X-offset 0 (ly:music-property dynamic 'tweaks)))
dynamic))
rf = #(make-dynamic-script "rf")
rf = #(make-dynamic-script "rf")
ffz = #(make-dynamic-script "ffz")
ffz = #(make-dynamic-script "ffz")
pf = #(make-dynamic-script "pf")
pf = #(make-dynamic-script "pf")
sempp = #(make-dynamic-script (markup #:line( #:with-dimensions '(0 . 0)
sempp = #(make-attr-dynamic-script "sempre" "pp" "")
'(0 . 0) #:right-align #:normal-text #:italic "sempre" #:dynamic "pp")))
pdolce = #(make-attr-dynamic-script "" "p" "dolce")
ppdolce = #(make-attr-dynamic-script "" "pp" "dolce")
dolce = -\tweak #'X-offset #0 #(make-dynamic-script (markup #:halign -0.25 #:whiteout #:pad-markup 0.5 #:normal-text #:italic "dolce"))
sfpdolce = #(make-attr-dynamic-script "" "sfp" "dolce")
parenf = #(make-dynamic-script (markup #:line(#:normal-text #:italic #:fontsize 2 "(" #:dynamic "f" #:normal-text #:italic #:fontsize 2 ")")))
parenf = #(make-dynamic-script (markup #:line(#:normal-text #:italic #:fontsize 2 "(" #:dynamic "f" #:normal-text #:italic #:fontsize 2 ")")))
parenp = #(make-dynamic-script (markup #:line(#:normal-text #:italic #:fontsize 2 "(" #:dynamic "p" #:normal-text #:italic #:fontsize 2 ")")))
parenp = #(make-dynamic-script (markup #:line(#:normal-text #:italic #:fontsize 2 "(" #:dynamic "p" #:normal-text #:italic #:fontsize 2 ")")))
pdolce = #(make-dynamic-script (markup #:line(#:dynamic "p" #:with-dimensions '(0 . 0) '(0 . 0) #:normal-text #:italic "dolce")))
ppdolce = #(make-dynamic-script (markup #:line(#:dynamic "pp" #:with-dimensions '(0 . 0) '(0 . 0) #:normal-text #:italic "dolce")))
dolce = #(make-dynamic-script (markup #:line(#:concat (#:normal-text #:italic "do" #:with-dimensions '(0 . 0) '(0 . 0) #:normal-text #:italic "lce"))))
sfpdolce = #(make-dynamic-script (markup #:line(#:dynamic "sfp" #:with-dimensions '(0 . 0) '(0 . 0) #:normal-text #:italic "dolce" )))
bracketf = #(make-dynamic-script (markup #:line(#:concat(#:normal-text #:fontsize 3 "[" #:dynamic "f" #:hspace 0.1 #:normal-text #:fontsize 3 "]"))))
bracketf = #(make-dynamic-script (markup #:line(#:concat(#:normal-text #:fontsize 3 "[" #:dynamic "f" #:hspace 0.1 #:normal-text #:fontsize 3 "]"))))
bracketmf = #(make-dynamic-script (markup #:line(#:concat(#:normal-text #:fontsize 3 "[" #:dynamic "mf" #:hspace 0.1 #:normal-text #:fontsize 3 "]"))))
bracketmf = #(make-dynamic-script (markup #:line(#:concat(#:normal-text #:fontsize 3 "[" #:dynamic "mf" #:hspace 0.1 #:normal-text #:fontsize 3 "]"))))
bracketmp = #(make-dynamic-script (markup #:line(#:concat(#:normal-text #:fontsize 2 "[" #:hspace 0.2 #:dynamic "mp" #:normal-text #:fontsize 2 "]"))))
bracketmp = #(make-dynamic-script (markup #:line(#:concat(#:normal-text #:fontsize 2 "[" #:hspace 0.2 #:dynamic "mp" #:normal-text #:fontsize 2 "]"))))
...
@@ -1141,6 +1180,12 @@ whiteoutpp = #(make-dynamic-script (markup #:whiteout #:pad-markup 0.5 #:dynamic
...
@@ -1141,6 +1180,12 @@ whiteoutpp = #(make-dynamic-script (markup #:whiteout #:pad-markup 0.5 #:dynamic
whiteoutf = #(make-dynamic-script (markup #:whiteout #:pad-markup 0.5 #:dynamic "f"))
whiteoutf = #(make-dynamic-script (markup #:whiteout #:pad-markup 0.5 #:dynamic "f"))
whiteoutff = #(make-dynamic-script (markup #:whiteout #:pad-markup 0.5 #:dynamic "ff"))
whiteoutff = #(make-dynamic-script (markup #:whiteout #:pad-markup 0.5 #:dynamic "ff"))
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
sim = ^\markup{\italic "sim."}
sim = ^\markup{\italic "sim."}
%%% Thanks to "Gilles THIBAULT" <gilles.thibault@free.fr>, there is a way
%%% Thanks to "Gilles THIBAULT" <gilles.thibault@free.fr>, there is a way
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment