swingMusic for midi that works with partials
This commit is contained in:
parent
a558a0b02f
commit
ed30b34df2
@ -45,4 +45,28 @@ swing = \mark \markup {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
\include "swing.ly"
|
||||
|
||||
swingMusic =
|
||||
#(define-music-function (parser location music) (ly:music?)
|
||||
(define (partial-duration-length m)
|
||||
(let ((name (ly:music-property m 'name))
|
||||
(es (ly:music-property m 'elements))
|
||||
(e (ly:music-property m 'element)))
|
||||
(if (pair? es)
|
||||
(partial-duration-length (car es))
|
||||
(if (ly:music? e)
|
||||
(if (and (eq? name 'ContextSpeccedMusic) (eq? (ly:music-property e 'name) 'PartialSet))
|
||||
(ly:duration-length (ly:music-property e 'duration))
|
||||
(if (eq? name 'NoteEvent)
|
||||
ZERO-MOMENT
|
||||
(partial-duration-length e)
|
||||
)
|
||||
)
|
||||
ZERO-MOMENT))))
|
||||
#{
|
||||
\swing
|
||||
\applySwingWithOffset 8 #'(2 1) #(partial-duration-length music) #music
|
||||
#})
|
Loading…
Reference in New Issue
Block a user