Evolutionary hypernetworks (EHNs) are recently introduced models for learning higher-order probabilistic relations of data by an evolutionary self-organizing process. We present a method that enables EHNs to learn and generate music from examples. Short-term and long-term sequential patterns can be extracted and combined to generate music with various styles by our method. Based on a music corpus consisting of several genres and artists, an EHN generates genre-specific or artist-dependent music fragments when a fraction of score is given as a cue. Our method shows about 88% of success rate in partial music completion task. By inspecting hyperedges in the trained hypernetworks, we can extract a set of arguments that constitutes melodic structures in music.