Posted March 17, 20223 yr 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!
March 18, 20223 yr 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)
March 18, 20223 yr @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))
March 18, 20223 yr 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
March 18, 20223 yr (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)
March 18, 20223 yr 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