Here’s a small function I needed because I’m working with "binary counting patterns". All patterns must always have the same length (a fixed bit length determined by the largest value). (defun dec-to-bin-rhythm (ilist)
(let ((span (find-max (mapcar 'length (decimal-to-binary ilist)))))
(loop for i in (binary-rhythm span ilist 1 :type 1)
collect (loop for x in i
when (< x 0)
append (gen-repeat (abs x) 0)