Jump to content

Featured Replies

Posted

here is a little "sketched" function STEP-TO-PITCH , perhaps OM could further develop the function...

 

;;; FUNCTION

(defun step-to-pitch (&key steps pitches start)
  (let ((pos (car (position-item start pitches))))
    (append (list (nth pos pitches))
            (loop for i in steps
              ;; setting pos by add the step to pos
              do (setf pos (+ pos i))
              ;; when pitch-range to small then reset to lowest pitch+step
              ;; could be a more intelligent solution
              when (> pos (length pitches))
              do (setf pos (+ 0 i))
              collect (nth pos pitches)))))



;;; EXAMPLES

(step-to-pitch :steps '(1 1 -1 2 2 -1)
               :pitches '(c4 d4 e4 f4 g4 a4)
               :start 'c4)

;; => (c4 d4 e4 d4 f4 a4 g4)


(step-to-pitch :steps '(1 1 -1 2 2 -1)
               :pitches (expand-tonality '(c4 chromatic))
               :start 'c4)

;; => (c4 cs4 d4 cs4 ds4 f4 e4)


(step-to-pitch :steps '(1 1 -1 2 2 -1 5)
               :pitches (expand-tonality '(c4 messiaen-mode6))
               :start 'c4)

;; => (c4 d4 e4 d4 f4 gs4 fs4 gs4)


 

This is how the new function TONALITY-STEP will work:

 

tonality-step (scale step &key start ambitus (sort t))

(tonality-step '(c4 d4 e4 g4 a4 f4) '(1 1 -1 2 2 -1))
=> (c4 d4 e4 d4 f4 a4 g4)

(tonality-step '(c4 d4 e4 g4 a4 f4) '(1 1 -1 2 2 -1 5 3 2 3 -2 -2 1 1))
=> (c4 d4 e4 d4 f4 a4 g4 f5 c6 e6 a6 f6 d6 e6 f6)

(tonality-step '(c4 chromatic) '(1 1 -1 2 2 -1))
 => (c4 cs4 d4 cs4 eb4 f4 e4)

(tonality-step '(c4 messiaen-mode6) '(1 1 -1 2 2 -1 5))
=> (c4 d4 e4 d4 f4 gs4 fs4 d5)

(tonality-step '(c4 messiaen-mode6) '(1 1 -1 2 2 -1 5 3 2 3 -2 -2 1 1))
=> (c4 d4 e4 d4 f4 gs4 fs4 d5 fs5 bb5 d6 b5 gs5 bb5 b5)

(tonality-step '(c4 messiaen-mode6) '(1 2 -1 2 2 -1 5 3 2 3 -2 -2 1 1) :ambitus 'scale)
=> (c4 d4 f4 e4 fs4 bb4 gs4 e4 gs4 b4 e4 c4 bb4 b4 c4)

(tonality-step '(c4 messiaen-mode6) '(1 2 -1 2 2 -1 5 3 2 3 -2 -2 1 1) :ambitus '(c3 a4))
=> (c4 d4 f4 e4 fs4 bb3 gs4 e4 gs4 b3 e4 c4 bb3 b3 c4)

(tonality-step '((c4d4e4g4a4f4) (c3 messiaen-mode6) (c4d4e4g4a4f4))
               '((1 1 -1 2 2 -1)
                 (5 3 2 3 -2 -2 1 1)
                 (2 -1 3 2 3 -2 -2 1 1)))
=> ((c4 d4 e4 d4 f4 a4 g4)
    (c3 gs3 c4 e4 gs4 f4 d4 e4 f4)
    (c4 e4 d4 g4 c5 f5 d5 a4 c5 d5))

 

  • Author

great!!! :smile:

  • Author

extended idea: would be nice to do it with chords => instead of a scale, a sequence with chords...

thanx a lot for such a quick developing/implementation!!

  • Author

is it also possible to start at a specific pitch?

 

(tonality-step '(c4 d4 e4 g4 a4 f4) '(1 1 -1 2 2 -1) :start 'e4)

 

Just to let you know the TONALITY-MAP with :map 'shift is doing the same thing already :smile:

 

(tonality-step '(c4 messiaen-mode6) '(1 1 -1 (2 2 -1) 5 3 (2 3 -2) -2 1 1))
=> (c4 d4 e4 d4 f4gs4fs4 d5 fs5 bb5d6b5 gs5 bb5 b5)

(tonality-map '(messiaen-mode6 :map shift)
               (interval-to-pitch '(1 1 -1 (2 2 -1) 5 3 (2 3 -2) -2 1 1)))
=> (c4 d4 e4 d4 f4gs4fs4 d5 fs5 bb5d6b5 gs5 bb5 b5)

 

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