Compare commits
3 Commits
b4622b991f
...
b80900f367
| Author | SHA1 | Date | |
|---|---|---|---|
| b80900f367 | |||
| 7ef35839a5 | |||
| 53e40f7122 |
73
functions.ly
73
functions.ly
@@ -1,10 +1,64 @@
|
|||||||
|
|
||||||
|
|
||||||
|
stripArticulations = #(define-scheme-function
|
||||||
|
(music)
|
||||||
|
(ly:music?)
|
||||||
|
|
||||||
|
(define (strip-articulations-i o)
|
||||||
|
(define (f l)
|
||||||
|
(if (null? l)
|
||||||
|
'()
|
||||||
|
(let ((o (car l)))
|
||||||
|
(if (music-is-of-type? o 'articulation-event)
|
||||||
|
(f (cdr l))
|
||||||
|
(cons o (f (cdr l)))))
|
||||||
|
))
|
||||||
|
|
||||||
|
(let ((els (ly:music-property o 'elements)))
|
||||||
|
(map strip-articulations-i els))
|
||||||
|
|
||||||
|
(let ((arts (ly:music-property o 'articulations)))
|
||||||
|
(cond ((not (null? arts))
|
||||||
|
(let ((n-arts (f arts)))
|
||||||
|
(ly:music-set-property! o 'articulations n-arts)))))
|
||||||
|
|
||||||
|
o)
|
||||||
|
|
||||||
|
(strip-articulations-i (ly:music-deep-copy music))
|
||||||
|
)
|
||||||
|
|
||||||
|
forceAccidental = #(define-scheme-function
|
||||||
|
(on_off music)
|
||||||
|
(index? ly:music?)
|
||||||
|
|
||||||
|
(let ((yn (if (= on_off 0) #f #t)))
|
||||||
|
(define (force-accidental-i o)
|
||||||
|
(define (f o)
|
||||||
|
(cond ((music-is-of-type? o 'note-event)
|
||||||
|
(ly:music-set-property! o 'force-accidental yn)))
|
||||||
|
(force-accidental-i o)
|
||||||
|
o
|
||||||
|
)
|
||||||
|
|
||||||
|
(let ((els (ly:music-property o 'elements)))
|
||||||
|
(map f els))
|
||||||
|
|
||||||
|
(let ((arts (ly:music-property o 'articulations)))
|
||||||
|
(map f arts))
|
||||||
|
|
||||||
|
o
|
||||||
|
)
|
||||||
|
|
||||||
|
(force-accidental-i (ly:music-deep-copy music))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
rmtext = #(define-scheme-function
|
rmtext = #(define-scheme-function
|
||||||
(o)
|
(o)
|
||||||
(ly:music?)
|
(ly:music?)
|
||||||
(define (f o)
|
(define (f o)
|
||||||
(ly:music-set-property! o 'text "")
|
(ly:music-set-property! o 'text "")
|
||||||
|
(ly:music-set-property! o 'span-text "")
|
||||||
(let ((t (ly:music-property o 'name)))
|
(let ((t (ly:music-property o 'name)))
|
||||||
(let ((els (ly:music-property o 'elements)))
|
(let ((els (ly:music-property o 'elements)))
|
||||||
(if (null? els)
|
(if (null? els)
|
||||||
@@ -102,3 +156,22 @@ frr = #(define-scheme-function
|
|||||||
(rep 8 n)
|
(rep 8 n)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
none = #(define-scheme-function
|
||||||
|
(n1 n2 n3 n4 n5 n6 n7 n8 n9)
|
||||||
|
(ly:music? ly:music? ly:music?
|
||||||
|
ly:music? ly:music? ly:music?
|
||||||
|
ly:music? ly:music? ly:music?)
|
||||||
|
#{ \times 2/3 { $n1 $n2 $n3 }
|
||||||
|
\times 2/3 { $n4 $n5 $n6 }
|
||||||
|
\times 2/3 { $n7 $n8 $n9 }
|
||||||
|
#}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
tri = #(define-scheme-function
|
||||||
|
(n1 n2 n3)
|
||||||
|
(ly:music? ly:music? ly:music?)
|
||||||
|
#{
|
||||||
|
\times 2/3 { $n1 $n2 $n3 }
|
||||||
|
#}
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user