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.

Number of beats per measure

Featured Replies

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-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

Account

Navigation

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.