1. An automatic composition apparatus comprising: a processing unit that performs (i) a calculation process of calculating a matching level of each chord progression data item for a motif including a plurality of note data items, with reference to a plurality of note connection rules each of which defines a connection relation of consecutive note types, and (ii) a melody generating process of generating a melody based on the motif and the chord progression data items which matching levels are calculated.