Codas
You can create codas in your music by splitting it up into sections:
The "To Coda" text can be made with a \markup command:
The "D.C. al Coda" text can be made with \markup as well, and we can also insert a coda symbol:
For the score (I named it "music"), you can include each section once:
For the MIDI file (I named it "musicMidi"), you can include each section as it is played:
As usual, we have two \score blocks, one for the score and one for the MIDI file:
Similarly, a D.S. al Coda can be made aswell, but using the "segno" glyph:
Then include the sections once in the score:
Then you can include the sections as they are played in the MIDI file:
Again, we have two \score blocks, one for the score and one for the MIDI file: