On Sat 15 Oct 2016 at 07:36:41 (+0200), Mojca Miklavec wrote: > Hi, > > Thank you very much for some very useful suggestion. I'll reply to the > rest later, but I have one "objection" (I could probably have > mentioned that in my first post): > > On 15 October 2016 at 01:22, Flaming Hakama by Elaine wrote: > > > >> Is there a way to make this both appear correctly and play correctly > >> in a midi file? > > > > Similar to an earlier question, no, MIDI doesn't honor or respect repeats. > > This is not entirely true. I happily use a super easy way to make this work: > > melody = {...} > \unfoldRepeats { \melody } > > to generate the MIDI file and for simple repeats like > > \repeat volta 2 {...} \alternative {{...}{...}}) > > that simply works perfect.
Yes, that describes the "long-normal-repeat" structure documented in the manual, as used by classical composers in sonata form. Once you go beyond that structure, you just have repeated music fragments, and you're responsible for assembling the fragments yourself. As far as midi is concerned, LP will handle that structure even if you nest it, as in the attached. As you can see, it's the volta notation that struggles to render nested repeat structures. I haven't yet clapped eyes on a score that used the Y position of voltas to indicate inner and outer repetition loops. LP offers plenty of notational alternatives to use in assembling fragments, but there's too much variety of outcomes for a single conventional construction (equivalent to \repeat) to be useful. The notations available are just markups: you'll notice that syntax editors don't indent repeated sections on their account, unlike \repeat. > I'm just saying that it would be awesome if I could convince > \unfoldRepeats to be able to obey some more complex scenarios. Indeed it would. I would wonder at LP's ability to read my intentions and be fearful about what else it was divining. > (But I believe that tagging will do the trick.) Yes, or just assemble fragments as appropriate. Cheers, David.
melodyIntro = { d'1 1 } melodyA = { e'1 1 } melodyAI = { f'1 } melodyAII = { g'1 } melodyB = { a'1 1 } melodyBI = { b'1 } melodyBII = { c''1 } melodyC = { d''1 1 } melodyCI = { e''1 } melodyCII = { f''1 } melodyOutro = { g''1 1 } mus = { \melodyIntro \repeat volta 2 { \repeat volta 2 { \melodyA } \alternative { { \melodyAI } { \melodyAII } } } \alternative { { \repeat volta 2 { \melodyB } \alternative { { \melodyBI } { \melodyBII } } } { \repeat volta 2 { \melodyC } \alternative { { \melodyCI } { \melodyCII } } } } \melodyOutro } \markup { Intro-A1-A2-B1-B2-A1-A2-C1-C2-Outro } \score { \mus } \score { \mus \midi { \tempo 1=60 } } \score { \unfoldRepeats \mus } \score { \unfoldRepeats \mus \midi { \tempo 1=60 } }
recurs.pdf
Description: Adobe PDF document
recurs-00.midi
Description: MIDI audio
recurs-01.midi
Description: MIDI audio
_______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user