According t0 classical education of music theory, music is generally defined by:
The real question is whether music must have all those qualities, or just some of them?
Many genres in Western music, have these qualities, including classical, rock, jazz, pop, but some say these definitions are self-serving. For example, harmony was one of the very last elements of music to evolve and melody is not much older. The fact music, like humanity itself, evolves. It had rhythm and it had tones: what they didn’t have was melody: percussion instruments were invented first, and then they mimicked the sounds of birds using primitive flutes and whistles. So Rap, like those ancient rhythmic chants, are a form of “music”.
It just took thousands of years to get where we had a choice!