Posted September 29, 20168 yr 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
September 29, 20168 yr 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