;\r
; -> Does not handle repeats.\r
;\r
+; -> Ignores \bar commands (and does not get confused by a | inside a \bar)\r
+;\r
\r
; Recognizes pitch & octave\r
(setq pitch-regex "\\([a-z]+[,']*\\|<[^>]*>\\)\\(=[,']*\\)?")\r
(goto-char (match-end 0))\r
(if (member (match-string 1) Parm-Keywords)\r
(progn\r
- (if (looking-at "[ \t\n]*\\([a-z0-9_]+\\|{[^}]*}\\)")\r
+ (if (looking-at "[ \t\n]*?\\([a-z0-9_]+\\|{[^}]*}\\|\"[^\"]*\"\\)")\r
(goto-char (match-end 0))\r
(error "Improper regex match:")\r
(error "Unknown text: %s")\r
))))))\r
\r
+(defun find-measure-start ()\r
+ (let ((start (re-search-backward "\|" 0 t)))\r
+ (if (null start)\r
+ -1\r
+ (if (looking-at "[^ \n\t]*\"")\r
+ (find-measure-start)\r
+ (point)\r
+))))\r
+\r
(defun get-beat ()\r
(save-excursion\r
(save-restriction\r
(let* ((end (point))\r
- (measure-start (or (re-search-backward "\|" 0 t) -1))\r
+ (measure-start (find-measure-start))\r
(last-dur (or (re-search-backward duration-regex 0 t) -1))\r
(duration (if (= -1 last-dur) 0 (parse-duration (match-string 0))))\r
(result '(0 1))) ; 0 in fraction form\r