;;; 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