A program storage medium readable by an apparatus for composing a melody, tangibly embodying a program of instructions executable by the apparatus to perform method steps for composing a melody by switching musical phrases sequentially corresponding to key input signals, and playing the switched musical phrases smoothly, said method comprising the steps of:
- a key input step of inputting the key input signals generated by a key input means;
- a selection step of selecting a musical phrase data corresponding to the key input signal from among a plurality of musical phrase data including at least a phrase change information data to change the musical phrase data, and at least a note data including a note of which a musical phrase consists;
- and
- a play step of reading the musical phrase data selected by the selection step, and playing the musical phrase corresponding to the musical phrase data;
- wherein in said selection step, said musical phrase data is selected in correspondence with said key input signal at the timing which the latest phrase change information data is read after said key input signal being detected during said musical phrase being played;
- wherein in said selection step, each of said musical phrase data consists of said note data having a predetermined scale note value and read timing, and said phrase change information data having a predetermined read timing;
- and
- wherein said scale note value and read timing are predetermined so that said melody is smoothly generated in tune and in rhythm when musical phrases are sequentially played according to said note data which are included in said musical phrase data being selected in said selection step .