I don’t think there is a formal theory of melody for Western music - I could be wrong, but if there is, it’s not very well known. Not saying there isn’t some discussion or writing about it, but not a formal theory. Indian music has a strong theory of melody in the definition of ragas, what they mean, when they are used, etc., but Western music seems to have no such detailed categorization.I think that the problem is that people tend to think that the vertical chordal approach is theoretical and the linear, melodic approach isn’t - and so no study is done and they “fly blind”.
The linear approach still needs to be informed, and many accomplished players cite the importance of transcription.
Likewise, there isn’t a formal theory of Western rhythm that I know of. I know Afro-Cuban practitioners have names for particular rhythms, with pretty detailed parts for different instruments (merengue, cumbia, guaracha, bolero, samba, etc.), along with the rhythmic base of the clave, and we have common names for rhythmic styles in jazz (swing, bossa nova, two beat, etc.), but an all-encompassing theory of rhythmic figures, such as we have for Western harmony, is not there.
Melody and rhythm seem to be the primary carriers for things that we lump into the category of “style”, so listening to these aspects should be at least as important than harmony - yet harmony gets the most attention in academia.
All the more reason to do focused listening, transcribing, playing along with tunes you like, these types of things - you have to absorb these important stylistic elements by immersion and osmosis. We don’t seem to have a formal approach to these aspects of music like we do with harmony. Too bad, really. But being aware of this lack may help us perennial students pay attention to them more closely.
