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.

Featured Replies

Dear, All

 

I need a function for shuffle elements. A function similar to URN in Pure Data.

 

The scenario:

 

1) I have a list of durations:

s s -s s s -s -s -s e -s s -s s -e e -e -e s -s

2) The lenghts together form a 6/4 timesignature or a 12/8.

3) Just repeating the rhythm is BORING !

4) I need variations, but I want to still sum 12/8 or 6/4.

5) So, I need to shuffle this elements, without changing the total of the sum of lenghts.

 

TWO APPROACHES:

 

 

1) RANDOM - How to randomize, not like the random sample, but, using each element JUST ONCE,

like an Hamiltonian Path ?

(Actually I don't like to random things, because I feel like I'm not composing...) I'm a control Freak ! Sorry !

2) RANDOM2 - How can I sort from sublists of the same rhtyhm EACH LIST MUST APPEAR JUST ONCE !

This approach sounds more controled

3) MY PREFERED ! How to split the lenght list, and make up combinations of sublists (absolutely controlled) ?

Like this:

 

COMPLETE LIST - (s s -s s s -s -s -s e -s s -s s -e e -e -e s -s)

 

 

SUB LISTS 1 (s s -s)

SUB LISTS 2 (s s -s -s )

SUB LISTS 4 (-s e -s s -s)

SUB LISTS 5 (s -e e -e)

SUB LISTS 6 (-e s -s)

 

Maybe I can Initialize each one as a setf

Brute force method...

 

(setf subleng1 ' (s s -s))

(setf subleng2  '(s s -s -s ))

(setf subleng3 '(-s e -s s -s))

(setf subleng4 '(s -e e -e))

ETC....

 

And after that use assemble-seq to the lenghts ?

Or assemble-seq is just for joining sections of the composition ?

 

Any help ?

Thank you all !!!

Best,

Julio

 

 

 

 

  • Author

Maybe Sort-series ?

Getting closer

 

(sort-series '(a d) '((4 6 2 3) (8 6 9 2) (4 6 3 7) (6 4 7 1))
              :section '(0 2 3))
=> ((2 3 4 6) (8 6 9 2) (3 4 6 7) (7 6 4 1))

 

  • Author

rnd-order !!!

oh yeah !

added 3 minutes later
7 minutes ago, JulioHerrlein said:

rnd-order !!!

oh yeah !

rnd-unique

  • Author

I'm trying this now...

Workout from Nigel Morgan book

But need some help..

 

Rhythm list

(setf r1 '(s s -s)
      r2 '(s s -s)
      r3 '(-s -s e -s)
      r4 '(s -s s -e)
      r5 '(e -e -e s -s))
      
;; shuffling 10 times
(let ((r-lis nil))
 (dotimes (i 10)
  (push (rnd-unique 5'(1 2 3 4 5)) r-lis))
 r-lis)
 
;; Here is the problem: no succes to assemble
(setf r-list (assemble-section 'r r-lis))

> Error: "3" doesn't match array element type of "r
While executing: ccl::concat-to-simple*, in process Listener-1(6).

 

Please, help !

Best,

Julio

 

(setf r1 '(s s -s)
      r2 '(s s -s)
      r3 '(-s -s e -s)
      r4 '(s -s s -e)
      r5 '(e -e -e s -s))

You need to flatten the list first:

(setf seq
      (flatten
       (let ((r-lis nil))
         (dotimes (i 10)
           (push (rnd-unique 5 '(1 2 3 4 5)) r-lis))
         r-lis)))

(setf r-list (assemble-section 'r seq))

 

You could do that:

(setf r1 '(s s -s)
      r2 '(s s -s)
      r3 '(-s -s e -s)
      r4 '(s -s s -e)
      r5 '(e -e -e s -s))

(setf seq (flatten (gen-eval 10 '(rnd-unique 5 '(1 2 3 4 5)))))
(setf r-list (assemble-section 'r seq))

 

  • Author
6 minutes ago, opmo said:

(setf r1 '(s s -s) r2 '(s s -s) r3 '(-s -s e -s) r4 '(s -s s -e) r5 '(e -e -e s -s)) You need to flatten the list first: (setf seq (flatten (let ((r-lis nil)) (dotimes (i 10) (push (rnd-unique 5 '(1 2 3 4 5)) r-lis)) r-lis))) (setf r-list (assemble-section 'r seq))

PERFECT !!!

added 2 minutes later
9 minutes ago, opmo said:

(setf r1 '(s s -s)
      r2 '(s s -s)
      r3 '(-s -s e -s)
      r4 '(s -s s -e)
      r5 '(e -e -e s -s))

You need to flatten the list first:

(setf seq
      (flatten
       (let ((r-lis nil))
         (dotimes (i 10)
           (push (rnd-unique 5 '(1 2 3 4 5)) r-lis))
         r-lis)))

(setf r-list (assemble-section 'r seq))

 

You could do that:


(setf r1 '(s s -s)
      r2 '(s s -s)
      r3 '(-s -s e -s)
      r4 '(s -s s -e)
      r5 '(e -e -e s -s))

(setf seq (flatten (gen-eval 10 '(rnd-unique 5 '(1 2 3 4 5)))))
(setf r-list (assemble-section 'r seq))

 

More Elegant !

 

8 minutes ago, opmo said:

(setf r1 '(s s -s)
      r2 '(s s -s)
      r3 '(-s -s e -s)
      r4 '(s -s s -e)
      r5 '(e -e -e s -s))

You need to flatten the list first:

(setf seq
      (flatten
       (let ((r-lis nil))
         (dotimes (i 10)
           (push (rnd-unique 5 '(1 2 3 4 5)) r-lis))
         r-lis)))

(setf r-list (assemble-section 'r seq))

 

You could do that:


(setf r1 '(s s -s)
      r2 '(s s -s)
      r3 '(-s -s e -s)
      r4 '(s -s s -e)
      r5 '(e -e -e s -s))

(setf seq (flatten (gen-eval 10 '(rnd-unique 5 '(1 2 3 4 5)))))
(setf r-list (assemble-section 'r seq))

 

 

added 3 minutes later

Thanks a lot, Janusz !

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

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.