(PWGLDef no-voice-crossing ((voices 0) ;<== the second argument is the initial values and should be placed in :initvals for OM (input-mode () (ccl::mk-menu-subview :menu-list '(":all" ":beat" ":1st-beat" ":1st-voice"))) ;<== This should be placed in the :menuins for OM (gracenotes? () :gracenotes?-include-mbox) <== should be removed - no gracenotes in OM &optional (rule-type () :rule-type-mbox) ;<== This should be placed in the :menuins for OM (rule-type is defined in the Cluster-Engine rpitch-pitch method) (weight 1)) ;<== the second argument is the initial values and should be placed in :initvals for OM "Voices should not cross, i.e., the pitch of simultaneous note pairs in voices are always sorted in decreasing order. Arguments are inherited from r-pitch-pitch." ;<== should be placed in :doc for OM () <=== This empty list should be removed ; =============================================================================== ; This is the LISP code part ; =============================================================================== (let ((sorted-voices (sort voices #'<))) (mappend #'(lambda (voice1 voice2) (r-pitch-pitch #'(lambda (pitches) ;; no rests -- no NILs (apply #'>= (remove NIL pitches))) (list voice1 voice2) '(0) input-mode gracenotes? :pitch rule-type weight)) (butlast sorted-voices) (rest sorted-voices)))) ; =============================================================================