We consider several perceptual issues in the context of machine recognition ofmusic patterns. It is argued that a successful implementation of a musicrecognition system must incorporate perceptual information and error criteria.We discuss several measures of rhythm complexity which are used fordetermining relative weights of pitch and rhythm errors. Then, a new methodfor determining a localized tonal context is proposed. This method is based onempirically derived key distances. The generated key assignments are then usedto construct the perceptual pitch error criterion which is based on noterelatedness ratings obtained from experiments with human listeners.