The paper presents the adaptation process of an Ant Colony Optimization system to the task of composing music. The main aims of the study include designing and implementing the above-mentioned system, conducting research, measuring the obtained results, and drawing conclusions. The application was implemented in Python and it allows you, based on the loaded MIDI file, to generate new melodies played on various instruments. The way of composing a melody is configurable by modifying the parameters of the ACO algorithm and different composition modes. To measure the quality of the obtained results, an evaluation function was created, which is used in research to measure the correlation between the parameters of the system. Based on the conducted research, it was determined how individual parameters affect the results obtained by the system. The paper covers the presentation of theoretical knowledge, system design, implementation description, research, and conclusion.