From c991eb5d49a1b36c81a890c4574f75d8834bb9a0 Mon Sep 17 00:00:00 2001 From: Trevor Daniels Date: Thu, 19 Jan 2017 20:47:36 +0000 Subject: [PATCH] Issue 185 Squishing chords Add a user-level interface to the event-chord-reduce function. Document its use for squishing chords in music being used to provide the rhythms to RhythmicStaff and the Pitch_squash_engraver. --- Documentation/notation/rhythms.itely | 16 ++++++++++++++++ ly/music-functions-init.ly | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/Documentation/notation/rhythms.itely b/Documentation/notation/rhythms.itely index 9d4a756346..8dc6252eca 100644 --- a/Documentation/notation/rhythms.itely +++ b/Documentation/notation/rhythms.itely @@ -1929,6 +1929,22 @@ be done with the @code{Pitch_squash_engraver} and >> @end lilypond +Music containing chords can also be used as input to @code{RhythmicStaff} +and for use with the @code{Pitch_squash_engraver} if the chords are first +reduced to single notes with the @code{\reduceChords} music function: + +@lilypond[quote,verbatim] +\new RhythmicStaff { + \time 4/4 + \reduceChords { + 2 + 2 + 2 + 4 + 4 + } +} +@end lilypond @predefined @code{\improvisationOn}, diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly index 1f94319bce..d7eba42a4b 100644 --- a/ly/music-functions-init.ly +++ b/ly/music-functions-init.ly @@ -1506,6 +1506,12 @@ usually contains spacers or multi-measure rests.") 'element main-music 'quoted-music-name what)) +reduceChords = +#(define-music-function (music) (ly:music?) + (_i "Reduce chords contained in @var{music} to single notes, +intended mainly for reusing music in RhythmicStaff. Does not +reduce parallel music.") + (event-chord-reduce music)) relative = #(define-music-function (pitch music) -- 2.39.2