Jump to content

Featured Replies

Posted

Dear all,

 

Is it possible to split a given list of lengths (or omn) into sublists (bars) according to a given sequence of time signatures? That would be very useful for all sorts of operations. e.g., imposing a meter on unmetered music generated by whatever algorithm; metric shift where some note or rest is added at the beginning of a rhythm, but the metric structure is kept the same and all notes/rests move "to the right" as necessary etc. 

 

Here is an example of what such a function could do. 

 

;; the hypothetic function gen-bar expects a list of time signature forms (or bar durations as ratios) and a (flat) list of lengths or OMN. It returns the lengths/OMN split into sublists according to the time signatures.    

(gen-bar '((3 4 2)) '(1/4 1/4 1/8 1/8 1/2 1/4))
-> ((1/4 1/4 1/8 1/8) (1/2 1/4))
(gen-bar '((3 4 2))  '(1/4 1/4 1/2 1/8 1/8 1/4))
->  ((1/4 1/4 1/4 tie) (1/4 1/8 1/8 1/4))

 

The hypothetical gen-bar is quasi an inversion of the existing function get-time-signature.

 

Such functionality seems so basic considering the OMN representation that perhaps something like this is already there and I simply cannot find it?

 

Thanks! 

 

Best,

Torsten

  • Author

Minor addition for clarity: split-lengths does not what I am after.

OMN-TO-TIME-SIGNATURE is the function you are looking for:

 

(setf time-signatures '((1 4 1) (3 4 2) (4 4)))

(setf omn1 '(-q q c5 p eb4 h gb4 q gb5 p a4 f
             c5 q c6 p eb5 gb5 q gb6 p a5 c6))

(omn-to-time-signature omn1 time-signatures)
=> ((-q) (q c5 p eb4 gb4 tie) (q gb4 p gb5 a4 f)
    (q c5 f c6 p eb5 gb5) (q gb6 p a5 c6))

 

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