lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: accordion, single note for chords, midi


From: Thomas Morley
Subject: Re: accordion, single note for chords, midi
Date: Wed, 13 Apr 2016 23:59:38 +0200

2016-04-13 23:39 GMT+02:00 Gianmaria Lari <address@hidden>:
> Ciao Thomas
>
> [How can I make lilypond display single note in the score but generate
> chords in the midi file?]
>
>> Maybe:
>>
>> \version "2.19.36"
>>
>> m = \chordmode { c4 d:m e:m7 }
>>
>> \score {
>>   \new Staff $(event-chord-reduce m)
>> }
>>
>> \score {
>>   \new Staff \m
>>   \midi {}
>> }
>
>
> this does not work on my pc (with lilypond 2.19.39), but it works if I
> change the order of the score block like this:
>
> \version "2.19.36"
>
> m = \chordmode { c4 d:m e:m7 }
>
> \score {
>   \new Staff \m
>   \midi {}
> }
>
> \score {
>   \new Staff $(event-chord-reduce m)
> }
>
> Obviously now I have to understand what's $(event-chord-reduce m) does but
> this is another story!

event-chord-reduce is from music-functions.scm
Maybe a music-function for lily-code will help even more:

eventChordReduce =
#(define-music-function (music)(ly:music?)
;; Doc-string of `event-chord-reduce' from music-functions.scm:
  "Reduces event chords in @var{music} to their first note event,
retaining only the chord articulations.  Returns the modified music."
  (event-chord-reduce music))

m = \chordmode { c4 d:m e:m7 }

\score {
  \new Staff \eventChordReduce \m
}

> Thank you Thomas!
>
> Also thank you to Simon, your idea is very clear and very neat, I will try
> it.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]