Jump to content

Featured Replies

Posted

use it if you like.. i needed it as a subfuction for length-legato* ...

greetings

andré

 

(defun symmp (seq)
  (let ((seq2 (if (evenp (length seq))
                (list (filter-first  (/ (length seq) 2) seq)
                      (reverse (filter-last (/ (length seq) 2) seq)))
                (list (filter-first (/ (1- (length seq)) 2) seq) 
                      (reverse (filter-last (/ (1- (length seq)) 2) seq))))))

    (if (null (member 'nil (loop 
                             for i in (car seq2)
                             for j in (cadr seq2)
                             when (equal i j)
                             collect 'T else collect 'NIL)))
      't)))

  
(symmp '(-1 2 3 5 5 3 2 -1))
(symmp '(-1 2 3 5 7 5 3 2 -1))
(symmp '(-1 2 3 4 5 3 2 -1))


(symmp '(c4 d4 fs5 d4 c4))
(symmp '(c4 d4 fs5 d4 b4))

(symmp '(mf f mp mp f mf))
(symmp '(mf f f mp fff f mf))

 

Create an account or sign in to comment


Copyright © 2014-2025 Opusmodus™ Ltd. All rights reserved.
Product features, specifications, system requirements and availability are subject to change without notice.
Opusmodus, the Opusmodus logo, and other Opusmodus trademarks are either registered trademarks or trademarks of Opusmodus Ltd.
All other trademarks contained herein are the property of their respective owners.

Powered by Invision Community

Important Information

Terms of Use Privacy Policy