January 25Jan 25 You can create the infinity series from binary numbers. ones are added, zeros reverse sign.Jesper(defun inf-ser (n &optional (offset 0) &aux tmp) (loop for i to (1- n) do (setf tmp 0) (loop for bin in (decimal-to-binary i) do (setf tmp (if (zerop bin) (- tmp) (+ tmp bin)))) ;(format t "~B = ~D~%" i tmp) collect (+ tmp offset)))(integer-to-pitch (inf-ser 128))(integer-to-pitch (inf-ser 128 12))
January 30Jan 30 Author Fractal properties;; added step(defun inf-ser (n &key (offset 0) (step 1) &aux tmp)(loop for i to (* (1- n) step) by step do(setf tmp 0)(loop for bin in (decimal-to-binary i)do(setf tmp (if (zerop bin) (- tmp) (+ tmp bin))));(format t "~B = ~D~%" i tmp)collect (+ tmp offset)))(setf orig (integer-to-pitch (inf-ser 128 :offset 12 :step 1)));;every second number = inverted series(setf sec (integer-to-pitch (inf-ser 128 :offset 12 :step 2)))(setf inv-sec (pitch-invert sec))(equal orig inv-sec);;every 4, 16, 64… = original series(setf fourth (integer-to-pitch (inf-ser 128 :offset 12 :step 4)))(equal fourth orig)Jesper
Create an account or sign in to comment