Skip to content
View in the app

A better way to browse. Learn more.

Learn more

Featured Replies

Here is a rather simple function that might be useful for others as well. 

 

The function rotate-omn rotates a sequence by the given number of positions, much like gen-rotate. However, you can specify which parameter you want to rotate, whether you want to rotate the flattened sequence or subsequences separately, or only certain subsequences. 

(setf melody '((-h q c4) (q. f4 e g4 q a4) (h. g4)))

(rotate-omn :right melody) 
; => ((-h q g4) (q. c4 e f4 q g4) (h. a4))

(rotate-omn :left melody :parameter :length) 
; => ((q c4 q. f4 e g4) (q a4 h g4 tie) (q g4 -h))

(rotate-omn 2 melody :section '(1) :flat nil)
; => ((-h q c4) (q. g4 e a4 q f4) (h. g4)) 

 

The function is part of my tot library (http://github.com/tanders/tot). It is a generalisation of the built-in gen-rotate, again with a short definition calling my function edit-omn. 

 

Best,

Torsten

 

Create an account or sign in to comment

Search

Search

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.