In a music retrieval system, a user presents a piece of music as a query and the system must identify from a corpus of performances other pieces with a similar melody. Several techniques have been proposed for matching such queries to stored music. In previous work, we found that local alignment, a technique derived from bioinformatics, was more effective than the n-gram methods derived from information retrieval; other researchers have reported success with n-grams, but have not compared against local alignment. In this paper we explore a broader range of n-gram techniques, and test them with both manual queries and queries automatically extracted from MIDI files. Our experiments show that n-gram matching techniques can be as effective as local alignment; one highly effective technique is to simply count the number of n-grams in common between the query and the stored piece of music. N-grams are particularly effective for short queries and manual queries, while local alignment is superior for automatic queries