Additive Tone

GEN-TABLES could be written a bit more succinctly, though both of these versions work correctly:

;;;Build list of tables/breakpoints to pass to siosc. 
(defun gen-tables (coef-lists pitch interval)
  (setf time interval)
  (setf tables ())
  (reverse (cdr                    ;list built in reverse. loop adds extra element.
    (dolist (coef-list coef-lists tables)
      ;;append wavetable and breakpoint, then increment.
      (setf tables (cons (normalize-table (gen-table coef-list)) tables))
      (setf tables (cons time tables))
      (setf time (sum time interval))))))



(defun gen-tables (coef-lists pitch interval)
  ;;; Push wavetable and breakpoint onto a list 'tables'.
  ;;; Discard the final breakpoint, then return 'tables' for siosc.
  (let ((count 1) tables)
    (dolist (coef-list coef-lists (reverse (cdr tables)))
      (push (normalize (gen-table coef-list)) tables)
      (push (* interval count) tables)
      (incf count))))