AM Posted May 8, 2016 Share Posted May 8, 2016 ;;; i coded this little function because i wanted to transpose a single pitch without having ;;; a list as output: in the library (pitch-transpose -12 '(c4)) -> (c3) ;;; (or is there such a function/format already in the library?) (defun single-pitch-transpose (pitch interval &key (midi-output 'nil)) (if (numberp pitch) (if (equal midi-output 'nil) (midi-to-pitch (+ interval pitch)) (+ interval pitch)) (if (equal midi-output 'nil) (midi-to-pitch (+ interval (pitch-to-midi pitch))) (+ interval (pitch-to-midi pitch))))) ;;example1 -> omn-in omn-out (single-pitch-transpose 'c4 -12) ;;example2 -> omn-in midi-out (single-pitch-transpose 'c4 -12 :midi-output t) ;;example3 -> midi-in omn-out (single-pitch-transpose 60 -12) ;;example4 -> midi-in midi-out (single-pitch-transpose 60 -12 :midi-output t) regards, AM Quote Link to comment Share on other sites More sharing options...
opmo Posted May 9, 2016 Share Posted May 9, 2016 (pitch-transpose-a 12 'c4) => c5 Quote Link to comment Share on other sites More sharing options...
AM Posted May 9, 2016 Author Share Posted May 9, 2016 thanks! it's not in the library yet? 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.