Jump to content
View in the app

A better way to browse. Learn more.

Opusmodus

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Get different random repeat at each draw with gen-repeat

Featured Replies

Hello

i would like to have this function to repeat 12 times different random repeats of 3 pitches at each draw and not as it does right now 12 times the same choice .

I know it is easy but i can't recall how i can achieve this 

(setf chords
      (gen-chord2 12 3
                  (gen-repeat
                   12
                   (rnd-repeat '(3) '(c4 cs4 e4 f4 g4 gs4 a4 b4)))
                  :offset '(2)
                  :transpose '(3 8 -3)))

Thanks 

Patrick

  • Author

Sorry but i think it does the same thing 

(setf chords
      (gen-chord2 12 3 
                  (gen-repeat 12
                              (rnd-sample 3 '(c4 cs4 e4 f4 g4 gs4 a4 b4)))
                  :offset '(2)
                  :transpose '(3 8 -3)))

=> (bb4d5d5 g5eb5g5 gs4gs4e4 bb4d5d5 g5eb5g5 gs4gs4e4
   bb4d5d5 g5eb5g5 gs4gs4e4 bb4d5d5 g5eb5g5 gs4gs4e4)
It repeats several times the same set of three chords . What i am looking for is to have 12 different chords 

Is this what you are looking for?

(gen-chord2 12 3 (flatten (gen-loop 12 (rnd-sample 3 '(c4 cs4 e4 f4 g4 gs4 a4 b4))))
 :offset '(2) :transpose '(3 8 -3))

=> (bb4d5b4 e5c5a4 bb3d4f4 b4d5gs4 cs5gs4cs5 d4a3d4
   gs4c5eb4 gs4c5cs5 d4e4cs4 g4g4b4 e5e5a4 bb3cs4f4)
  • Author

I am just looking to have 12 different repeats or draws from  

(rnd-sample 3 (c4 cs4 e4 f4 g4 gs4 a4 b4))

with at each repeat sample 3 new pitches from the list .

Or if you prefer 12 different evaluations of rnd-sample 3

It is in SCOM   

(g-eval nil  9 '(gen-random nil  3 '(a b c d e)))

This is what i am trying to do.

Thanks

Patrick

As you can see there is no many possibilities to create chords with the pitch list  '(b4 cs4 f4)

Maybe you need to think of a different approach:

(gen-loop 12 
 (gen-chord2 12 3
  (rnd-sample 3 '(c4 cs4 e4 f4 g4 gs4 a4 b4))
  :offset (rnd-sample 12 '(0 1 2))
  :transpose (rnd-sample 12 '(3 8 -3))))

Create an account or sign in to comment


Copyright © 2014-2026 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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.