Jump to content

Featured Replies

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

  • Author

thanks! it's not in the library yet?

 

Create an account or sign in to comment


Copyright © 2014-2025 Opusmodus™ Ltd. All rights reserved.
Product features, specifications, system requirements and availability are subject to change without notice.
Opusmodus, the Opusmodus logo, and other Opusmodus trademarks are either registered trademarks or trademarks of Opusmodus Ltd.
All other trademarks contained herein are the property of their respective owners.

Powered by Invision Community

Important Information

Terms of Use Privacy Policy