Jump to content

Featured Replies

Posted

Does anyone know if there's a function that outputs a number of beats from every measure in an omn sequence, given the denominator? For example with the eighth-note denominator, ((-e a3f4d5 q f4d5a5) (q a3e4c5 q e4c5a5) (-e a3g4e5 h g4e5a5)) would output (3, 4, 5).

 

Thank you!

violà... here's a solution...

but: you have a wrong OMN-structure in your code (-e a3f4d5 q ... => a rest followed by a pitch, i corrected it

 

 

(setf omnlist '((-e q f4d5a5) (q a3e4c5 q e4c5a5) (-e  h g4e5a5)))

(defun countbeats (omnlist &key (denom '1/8))
  (loop for i in omnlist
    collect (/ (sum (abs! (flatten (omn :length i)))) denom)))

(countbeats omnlist)
=> (3 4 5)

(countbeats omnlist :denom 1/16)
=> (6 8 10)

 

@André: isnt it so, that the length value is valid until the next length value regardless if its a rest or not?

Please correct me if I'am wrong..

(omn :length '((-e a3f4d5 q f4d5a5) (q a3e4c5 q e4c5a5) (-e a3g4e5 h g4e5a5))) 
==>((-1/8 1/8 1/4) (1/4 1/4) (-1/8 1/8 1/2))

 

yes, but it's - in my opinion - not very clear like that. difference: what you see and... what you get...

 

i always write it like this:

 

'((-e e a3f4d5 q f4d5a5) (q a3e4c5 q e4c5a5) (-e e a3g4e5 h g4e5a5)))

 

it makes more practical sense to me

... but my functions works for BOTH

(setf mat '((-e a3f4d5 q f4d5a5) (q a3e4c5 q e4c5a5) (-e a3g4e5 h g4e5a5)))

(get-time-signature mat)
=> ((2 4 2) (3 4 1))

(get-time-signature mat :group :numerator)
=> (((2) 4 2) ((3) 4 1))

(get-time-signature mat :group :denominator)
=> (((1 1) 4 2) ((1 1 1) 4 1))

(get-span mat)
=> (1/2 1/2 3/4)

 

  • Author

Thank you, all! This is very helpful. The AM solution gave me what I was looking for.

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