AM Posted December 24, 2015 Share Posted December 24, 2015 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é Quote Link to comment Share on other sites More sharing options...
opmo Posted December 24, 2015 Share Posted December 24, 2015 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) lviklund 1 Quote Link to comment Share on other sites More sharing options...
AM Posted December 24, 2015 Author Share Posted December 24, 2015 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.. Quote Link to comment Share on other sites More sharing options...
AM Posted December 24, 2015 Author Share Posted December 24, 2015 i will write a little function and post it at the forum later. Quote Link to comment Share on other sites More sharing options...
opmo Posted December 24, 2015 Share Posted December 24, 2015 '(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 :-) Quote Link to comment Share on other sites More sharing options...
opmo Posted December 25, 2015 Share Posted December 25, 2015 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) Stephane Boussuge 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.