Writing a song is a lot like writing a computer program. They both require clever management of loops and control flow. The simplest sheet music reads as a straightforward top-to-bottom list of instructions. You start on measure one and read through to the end sequentially. That’s fine unless the music is very repetitive, which most …