I'm experiencing strange troubles with detecting the loudest pitch in a region via MOVING-SPECTRUM. (I am assuming that freqs[i] is the loudest frequency when amps[i] is the loudest amp.) It outputs negative pitches and also I get a strange assertion failure where the loop counter becomes non-integer somehow:
(define (find-max-amp-index amps) (let* ((amp0 (find-max-amp amps)) (len (length amps)) (index 0)) (do ((i 0 (+ i 1))) ((= i len)) ;; how can this assertion possibly fail? (assert (integer? i)) (when (>= (vector-ref amps i) amp0) (set! index i))) index)) The repository includes the sound file and tests. https://gitlab.com/dto/mosaic-el/ Full information is at the bottom of the source file: https://gitlab.com/dto/mosaic-el/blob/master/mosaic.scm I would greatly appreciate any help you can offer. _______________________________________________ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist