A Wavelet-Based Approach to Pattern Discovery in Melodies