(defun square (x) (* x x)) (defun add-three (x y z) (+ x y z)) (defun palindrome (input-list) (append input-list (reverse input-list))) (defun palindrome-elided (input-list) (append input-list (cdr (reverse input-list)))) (defun repeat-ones (iterations) (cond ((<= iterations 0) nil) (t (cons 1 (repeat-ones (- iterations 1)))))) (defun get-first-hexachord (input-series iterator) (cond ((>= iterator 6) nil) (t (cons (car input-series) (get-first-hexachord (cdr input-series) (+ iterator 1)))))) (defun cheap-second-hexachord (input-series) (reverse (get-first-hexachord (reverse input-series) 0))) (defun get-second-hexachord (input-series iterator) (cond ((>= iterator 6) input-series) (t (get-second-hexachord (cdr input-series) (+ iterator 1))))) (defun transpose-row (input-series transposition-value) (cond ((null input-series) nil) (t (cons (mod (+ (car input-series) transposition-value) 12) (transpose-row (cdr input-series) transposition-value))))) (defun add-register (input-series base-value) (cond ((null input-series) nil) (t (cons (+ (car input-series) base-value) (add-register (cdr input-series) base-value))))) (defun rotate-left (input-hexachord) (append (cdr input-hexachord) (list (car input-hexachord)))) (defun rotate-right (input-series) (reverse (rotate-left (reverse input-series)))) (defun kreuzspiel (input-series) (append (rotate-left (get-first-hexachord input-series 0)) (rotate-right (get-second-hexachord input-series 0)))) (defun series (values start-time) (if (null values) nil (let* ((current-value (car values)) (current-rhythm (float (* 1/12 (+ current-value 1))))) (cons (new midi :time start-time :keynum (+ 60 current-value) :amplitude current-rhythm :duration current-rhythm) (series (cdr values) (+ start-time current-rhythm))))))