  In this paper, we propose a lightweight music-generating model based on
variational autoencoder (VAE) with structured attention. Generating music is
different from generating text because the melodies with chords give listeners
distinguished polyphonic feelings. In a piece of music, a chord consisting of
multiple notes comes from either the mixture of multiple instruments or the
combination of multiple keys of a single instrument. We focus our study on the
latter. Our model captures not only the temporal relations along time but the
structure relations between keys. Experimental results show that our model has
a better performance than baseline MusicVAE in capturing notes in a chord.
Besides, our method accords with music theory since it maintains the
configuration of the circle of fifths, distinguishes major and minor keys from
interval vectors, and manifests meaningful structures between music phrases.
