{'fraction_non_alphanumeric': 0.016843971631205674, 'fraction_numerical': 0.0008865248226950354, 'mean_word_length': 5.378531073446328, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A novel genetic algorithm considering measures and phrases for generating melody

Composing music through evolutionary algorithms has received increasing attention recently. To establish a standard of composing, some studies were proposed on the basis of analysis on musicians, statistics of music details, and rule of thumbs. These methods have achieved some promising results; however, generating melody is still a formidable challenge to computer composition because of the considerable permutations of notes. This study develops a genetic algorithm (GA) based on music theory to generate melody. In particular, we use the rhythm of existing songs as the basis to generate new compositions instead of generating music from scratch; that is, the GA keeps the rhythm of an existing song and rearranges the pitches of all notes for a new composition. Three crossover operators are further proposed to improve the performance of GA on composition. The experimental results show that the GA can achieve satisfactory compositions. The three crossover operators outperform 2-point crossover in the fitness of resultant compositions.