On 2021-03-24 1:07 am, Jacques Menu wrote:
This works, but with a second, empty staff:
\version "2.20.0"
\language "english"
\include "lilyjazz.ily"
global = { \time 4/4 \key f \major \tempo 4=100}
chordNames = \chordmode {f1:7 f:7 f:7 f:7}
\score {
<<
\global
\new ChordNames {
\chordNames
}
\new Voice
\with { \consists "Pitch_squash_engraver" }
{
\improvisationOn \omit Stem
\repeat unfold 16 { 4 }
}
>>
}
You need to be more explicit about creating staves and voices. Also,
you will want to remove the Note_performer so that the dummy slash notes
do not interfere with MIDI:
%%%%
\version "2.22.0"
global = { \time 4/4 \key f \major \tempo 4=100 }
chordNames = \chordmode { f1:maj7 e:7 a:m bes/c }
\score {
<<
\new ChordNames \chordNames
\new Staff <<
\new NullVoice \global
\new Voice
\with { \consists "Pitch_squash_engraver"
\remove "Note_performer" }
{
\improvisationOn \omit Stem
\repeat unfold 16 { c4 }
}
>>
>>
\layout {}
\midi {}
}
%%%%
And while we're at it... why not make the slashes automatically fit the
chord music?
%%%%
\version "2.22.0"
slashesForMusic =
#(define-music-function
(slash-duration reference-music)
(ly:duration? ly:music?)
#{ \new Voice
\with { \consists "Pitch_squash_engraver"
\remove "Note_performer" }
{ \improvisationOn \omit Stem
\repeat unfold
#(ly:moment-main (ly:moment-div
(ly:music-length reference-music)
(ly:duration-length slash-duration)))
{ c $slash-duration } } #})
global = { \time 4/4 \key f \major \tempo 4=100 }
chordNames = \chordmode { f1:maj7 e:7 a:m bes/c }
\score {
<<
\new ChordNames \chordNames
\new Staff <<
\new NullVoice \global
\slashesForMusic 4 \chordNames
>>
>>
\layout {}
\midi {}
}
%%%%
-- Aaron Hill