I think it&#x27;s fair to call a non-repeating sequence of randomly selected, sufficiently tonal notes, on a familiar scale, in the right frequency range, a melody.  So I don&#x27;t think it&#x27;s fair to say a melody is inherently non-random.  I&#x27;d say that there only needs to be a sequence of sounds identifiable as individual notes, with a sufficiently dominant pitch as to sound tonal.