Automatic click track: Difference between revisions
Appearance
Import snippet from LSR |
m New category Tags: Mobile edit Mobile web edit |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
Here is a simple function to automatically add a MIDI click track to any music expression, without altering the graphical output. | Here is a simple function to automatically add a MIDI click track to any music expression, without altering the graphical output. | ||
<lilypond version="2.24 | <lilypond version="2.24"> | ||
%%LSR contributed by vv on https://lists.gnu.org/archive/html/lilypond-user/2020-06/msg00070.html | %%LSR contributed by vv on https://lists.gnu.org/archive/html/lilypond-user/2020-06/msg00070.html | ||
| Line 31: | Line 31: | ||
[[Category:Rhythms]] | [[Category:Rhythms]] | ||
[[Category:Midi]] | [[Category:Midi]] | ||
[[Category:Snippet]] | |||
Latest revision as of 23:24, 21 November 2025
Here is a simple function to automatically add a MIDI click track to any music expression, without altering the graphical output.
\version "2.24"
%%LSR contributed by vv on https://lists.gnu.org/archive/html/lilypond-user/2020-06/msg00070.html
addTicks =
#(define-music-function (m) (ly:music?)
#{ << $m
\new Devnull \with {
\consists Drum_note_performer
\consists Staff_performer
\consists Dynamic_performer
midiInstrument = #"woodblock"
} \drummode {
<>\ff \repeat unfold
$(ly:moment-main-numerator
(ly:moment-div
(ly:music-length m)
(ly:make-moment 1 4)))
rb4 }>> #})
music = \relative c' { c2\pp d e f g a b c }
\score {
\new Staff \addTicks \music
\layout {}
\midi {}
}