Jump to content

Featured Replies

Posted

The following example randomly segments a list of given pitches into progressively increasing sublist of elements. I can't seem to recall a function one could use instead of rnd-repeat that would do the same but not randomly, preserving the original order or pitches => (c4) (d4 e4) (f4 g4 a4), etc.

 

Thank you!

 

(setf pitches '(c4 d4 e4 f4 g4 a4 b4 c5))
(setf seq 
      (make-omn
       :pitch (rnd-repeat (gen-integer 1 4) pitches)
       :length '(1/16)
       :velocity '(f)
       :articulation '(stacc)
       :span :pitch))

 

(gen-divide '(1 2 3 4 5 6) '(1 2 3 4 5 6 7 8 9 10))
=> ((1) (2 3) (4 5 6) (7 8 9 10))

 

too late 🙂

(setf pitches '(c4 d4 e4 f4 g4 a4 b4 c5))
(setf seq 
      (make-omn
       :pitch (gen-divide (gen-integer 1 4) pitches)
       :length '(1/16)
       :velocity '(f)
       :articulation '(stacc)
       :span :pitch))

 

  • Author

Thanks so much! That's it - so elegant. I just couldn't remember gen-divide😄

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