Skip to content

Instantly share code, notes, and snippets.

@j-bresson
Created February 5, 2023 23:27
Show Gist options
  • Save j-bresson/959385943f8aa76727f58beac7a34617 to your computer and use it in GitHub Desktop.
Save j-bresson/959385943f8aa76727f58beac7a34617 to your computer and use it in GitHub Desktop.
Fixes score objects generated from patches playing in the sequencer (v1.7)
(in-package :om)
(defmethod get-action-list-for-play ((c chord) interval &optional parent)
(let ((pitch-approx (when (and (not (equal :off (get-pref-value :score :microtone-bend)))
(micro-channel-on (pitch-approx c)))
(pitch-approx c))))
(let ((negative-offset (max 0 (- (loop for n in (notes c) minimize (offset n))))))
(get-action-list-of-chord (or (player-info c) :midi) (notes c) negative-offset interval pitch-approx
(extras c))
)))
(defmethod get-action-list-for-play ((n note) interval &optional parent)
(let ((pitch-approx (when (and (not (equal :off (get-pref-value :score :microtone-bend)))
(micro-channel-on (pitch-approx n)))
(pitch-approx n))))
(get-action-list-of-chord (or (player-info n) :midi) (list n) 0 interval pitch-approx)))
(defmethod get-action-list-of-voice (object player interval pitch-approx)
(sort
(loop for c in (remove-if #'(lambda (chord)
(let ((t1 (+ (date chord) (list-min (loffset chord))))
(t2 (+ (date chord) (loop for n in (notes chord) maximize (+ (offset n) (dur n))))))
(or (< t2 (car interval))
(>= t1 (cadr interval)))
))
(chords object))
append
(get-action-list-of-chord (or player :midi) (notes c) (date c) interval pitch-approx
(extras c)))
'< :key 'car)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment