;;; OpenMusic Patch (OM 7.6) (in-package :om) (make-patch 'ColorNotes '((voice :in t) (indices :in t) (colored-voice :out t)) '() '((colored-voice (om-lisp "(defun color-notes-by-index (voice indices) (let* ((notes (copy-seq (om::voice-chords voice))) (colored-notes (mapcar #'(lambda (n idx) (if (member idx indices) (om::set-chord-color n '(1.0 0.0 0.0)) n)) notes (loop for i from 0 below (length notes) collect i)))) (om::make-voice colored-notes)))" (list voice indices)))))