Are there any mathematical methods for identifying melodic shape, identifying motifs and general pattern recognition?
closed as too broad by David Bowling, Tim, ggcg, Doktor Mayhem♦ Jan 25 at 13:33
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
You might be interested in checking out "Relating Musical Contours: Extensions of a Theory of Contour," a highly influential article in the study of musical contour. As a brief introduction, they consider a cseg (contour segment) to be an ordered representation of a musical line; <502314> is the cseg of the following excerpt:
(In short, you just take the available pitches, order them from lowest to highest starting on 0, and then list each pitch's placement. See the discussion of "c space" in the article.)
From there, you can then relate contours through constructions of matrices:
There's much more to it than that, but hopefully that whets your appetite if you're interested in studying further.
Since this sounds like it's for a high school lecture, you may want to stop there; the math in that article isn't rough at all. But if you're interested in getting into some more advanced math (or just checking out what else is available), I'll also recommend "New Directions in the Theory and Analysis of Musical Contour" and "Fuzzy Extensions to the Theory of Contour."
You actually should consider checking out the work of Guerino Mazzola and Jan Beran. Both come from Switzerland and seem to have a different approach. Jan Beran teaching at University of Konstanz nowadays, was studying records of different people playing one piece of music and was using analytical methods to study how a piece would sound. Guerino Mazzola seems to concentrate more on how the theory works and is using more algebraic methods to describe music.
"identifying melodic shape, identifying motifs and general pattern recognition" is a question of data analysis and data science, which is using different data sets. So yes, of course, something like this does exist with the right underlying statistical model. Maybe you can find some statistical models in Jan Beran's Statistics in Musicology.