While Optical Music Recognition (OMR) of modern printed and handwritten documents is considered a solved problem, with many commercial systems available today, the OMR of ancient musical manuscripts still remains an open problem. In this paper we present a system for the OMR of degraded western plainchant manuscripts in square notation from the XIV to XVI centuries. The system has two main blocks, the first one deals with symbol extraction and recognition, while the second one acts as an error detection stage for the first block outputs. For symbol extraction we use widely known image-processing techniques, such as Sobel filtering and Hough Transform, and SVM for classification. The error detection stage is implemented with a hidden Markov model (HMM), which takes advantage of a priori knowledge for this specific kind of music.