As an experiment, I have built a small program that randomizes entered tones. For example we type in tones of a chorus melody of a famous hit, add exact melody rhythm and the program generates the same rhythm and uses the same tones but randomizes their order. If a chorus melody uses 5 different tones and has 8 consequent notes, that would be 8^5 = 32,768 possible melody variations.
If one is patient enough program will sooner or later generate the same melody sequence as an original hit melody. An interesting fact is if the operator has patience and adequate taste, the program will eventually generate an even better melody than the original melody (if there subjectively exists one), given the same notes and tone rhythm entered. That new melody is completely free to use because there would be no copyright issue. Of course, this is a bit painstaking procedure and not a way to compose, but it may be interesting from the theoretical point - for every famous hit melody you may try to find out if it is the best possible tone sequence given the same tones and rhythm used, or it could be improved. Only for patient ones with plenty of spare time to spend

The majority of hit chorus melodies have between 4 and 8 consecutive notes, while pitch-wise they use 2 to 6 different tones. That makes 64 to 8000 possible melody combinations. If an operator uses 6 sec for listening to each variation 600 different melody combinations can be evaluated per hour. Since more tones or more tone pitches raises possible melody combinations exponentially, it may be good to experiment with smaller melody phrases and combine them by using melody math rules (phrase repetition etc). For example, 5 tone melody containing 4 different pitches requires 625 melody combinations that could be done in an hour, while 5 tone melody that uses 5 pitches would need 5 hours (3125 combinations). But it could be done because the majority of for example Cheiron hit melodies don't surpass 5 consequent melody notes and use no more than 5 different tone pitches. That makes 3125 melody combinations, which would take 5 hours to evaluate. Not too much if you could discover chorus melody equal in quality to those of Cheiron guys and you would be free to use it. To acomplish that good taste would be of great importance.