Search the Community
Showing results for tags 'bar'.
Found 1 result
Splitting material into bars (sublists)
torstenanders posted a topic in Function ExamplesDear 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