Research on the Interaction of Genetic Algorithm in Assisted Composition
Algorithm 1
Algorithm for obtaining note and time value characteristics.
Input: MIDI Music Data: Music = { a.mid,b.mid,c.mid,d.mid ... ...}
(1)
Traverse each MIDI music file from the path where the music file is saved.
(2)
Gets the number of tracks per file.
(3)
Traverse every track in the file
(4)
Initializing a pitch array and a time value array, and sequentially extracting the pitch, start time and end time of each note in the audio track; Calculate the time difference and store it in the time value array: Get the information such as strength, speed, beat and mode and store it in the corresponding array.
(5)
Until all tracks are traversed
Output: Excel format file containing MIDI information