Posted December 24, 20159 yr simple question, perhaps someone could help me. i like to replace some ordinary notes (example) with an "acciaccatura"? example: from... '((e c6 q. ab5 3e g5 f5 e5 q f5 -)) to... '((acc c6) q. ab5 3e g5 f5 e5 q f5 -) ; = replace e c6 with (acc c6) i think, its not complicated but i didn't found the OMN-solution. thanx for your help!! andré
December 24, 20159 yr Is this what you are looking for: (substitute-motif '((e c6)) '(((acc c6))) '(e c6 q. ab5 3e g5 f5 e5 q f5 -)) => ((acc c6) q. ab5 3e g5 f5 e5 q f5 -) The SUBSTITUTE-MOTIF function is not documented but it is in the system. I will document the function in the next few days. Here are few more examples: (substitute-motif '((a b c) (d b)) '((1 2 3) (8 9)) '(d b s a b c e j g)) => (8 9 S 1 2 3 E J G) (substitute-motif '((a b c) (d b)) '((1 2 3) (8 9)) '(d b s a b c e j g) :otherwise 'x) => (8 9 x 1 2 3 x x x) (substitute-motif '(q) '(1 2 3) '(d b s a b c e j g a b c q q q)) => (D B S A B C E J G A B C 1 2 3 1 2 3 1 2 3) substitute-motif (old new list &key (test #'equal) otherwise)
December 24, 20159 yr Author yes, that's the way it will works... only one little "problem"... the pitch will be always different... so the search-pattern should be something like '(e ?) -> to '((acc ?) -> pitch sould be overtaken to (acc ?), i only want to replace the length-val to an acc..
December 24, 20159 yr '(e c6 acc q. ab5 3e g5 f5 e5 q f5 -) equal ((acc e c6) q. ab5 3e g5 f5 e5 q f5 -) Maybe this fact helps :-)
December 25, 20159 yr Other solution: (setf omn '(s. fs5 mf s p s. ff t f4 p fs5 s. mf t f -s)) (make-omn :length (omn :length omn) :pitch (omn :pitch omn) :velocity (omn :velocity omn) :articulation (substitute-motif '(3/32) '(acc) (omn :length omn) :otherwise '-)) => (s. fs5 acc s p s. ff acc t f4 p fs5 s. mf acc t f -s)
Create an account or sign in to comment