to use the function which works on event-numbers, first you have to number it (the score), so that you could work with this afterwards...
;;; ADD numbers to text attributes (can do that in your setup), then ADD number to events
;;; have a look to the example. after that, easy to use REPLACE-ON-EVENT-NUMBER etc...
(defun add-numbers-to-text-attributes (a b)
(loop for i from a to b
append (add-text-attributes (list (compress (list 'nr i)) (write-to-string i)))))
(add-numbers-to-text-attributes 0 100)
(defun add-num-to-events (omnlist)
(loop
for x in (single-events omnlist)
for i from 0 to (length (single-events omnlist))
when (omn-formp x)
collect (omn-replace :articulation (list (compress (list 'nr i))) x)
else collect x))
;;; evaluate cmd3
(setf seq (add-num-to-events '(-q q c4 mp -q -q e e e e e q c4 mp -q -q q c4 mp -q)))
=> ((-q) (q c4 mp nr1) (-q) (-q) (e c4 mp nr4) (e c4 mp nr5) (e c4 mp nr6) (e c4 mp nr7) (e c4 mp nr8) (q c4 mp nr9) (-q) (-q) (q c4 mp nr12) (-q))