1. An automatic composition apparatus comprising: a motif input unit that receives a motif including a plurality of note data items; and a processing unit that performs: a first calculation process of calculating each note type of the note data items received by the motif input unit, with respect to a plurality of chord progression data items, a second calculation process of calculating a matching level of each of the chord progression data items for the motif, with reference to a plurality of note connection rules each of which is used in evaluating a combination of the note types of consecutive notes and a difference between tones of the consecutive notes, the matching level being calculated based on the evaluation, a chord-progression selecting process of selecting a chord progression data item from among the plurality of chord progression data items based on the calculated matching levels, and a melody generating process of generating a melody based on the motif and the selected chord progression data item selected by the chord-progression selecting process.