Then we have intertextuality, like a quotation in a jazz solo. I think Parker quotes "White Christmas" in a solo on "Ornithology."
There is irony, as in the use of excessively simple or saccharine melodies that we don't feel are to be taken seriously. Parody as well.
The frustration of expectations, or misdirection, or surprise. The use of odd juxtapositions.
Funny timbres and tonalities, dissonances. It might be funny to use a kazoo.
I think Haydn is funnier than Mozart, and Monk funnier than Mingus, though the latter can be witty as well. Ellington is witty in a sophisticated way.
I never went in for the PDQ Bach stuff for some reason.
It takes some sophistication to hear humor in music, because many people approach music, especially classical music, with a deadly earnestness.