A musical piece generation method executed by a computer, the method comprising:
- acquiring target musical piece data indicating at least a part of a musical piece;
- acquiring a value of a difficulty level parameter;
- generating, by using a trained generative model, from the target musical piece data and the value of difficulty level parameter, new musical piece data indicating at least a part of a new musical piece obtained by changing a difficulty level of the musical piece to a difficulty level specified by the difficulty level parameter;
- and
- outputting the new musical piece data that has been generated.