Posted January 13, 201510 yr 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
January 13, 201510 yr Author 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..
January 14, 201510 yr 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)
Create an account or sign in to comment