o_e Posted January 13, 2015 Share Posted January 13, 2015 Hi, I want to make the following construction: (defun mapping-integers (x y) (interval-to-pitch (integer-to-interval x) :start y)) (mapping-integers '(0 4 5 9 11) 'c5) I get an error-warning having the wrong start parameter, how could this be done? I have a list of integers (0 4 5 9 11) and a list of root notes (c5) and want them to process to get lists like (c5 e5 f5 a5 b5).. ole Quote Link to comment Share on other sites More sharing options...
o_e Posted January 13, 2015 Author Share Posted January 13, 2015 to answer my own question, I found a workaround: (defun mapping-integers-2 (x y) (chordize (pitch-transpose (pitch-to-integer y) (integer-to-pitch x)))) (mapping-integers-2 '(0 4 5 9 11) 'g4) nevertheless I would like to know if it is possible to handle the keyword parameters with variables.. Quote Link to comment Share on other sites More sharing options...
opmo Posted January 14, 2015 Share Posted January 14, 2015 Solution: (pitch-transpose-start 'c5 (integer-to-pitch '(0 4 5 9 11))) => (c5 e5 f5 a5 b5) with &key (defun mapping-integers (l &key start) (if start (pitch-transpose-start start (integer-to-pitch l)) (integer-to-pitch l))) (mapping-integers '(0 4 5 9 11) :start 'c5) => (c5 e5 f5 a5 b5) with &optional (defun mapping-integers2 (l &optional start) (if start (pitch-transpose-start start (integer-to-pitch l)) (integer-to-pitch l))) (mapping-integers2 '(0 4 5 9 11) 'c5) => (c5 e5 f5 a5 b5) 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.