Interpolate non-fft values too
Signed-off-by: Skylar "The Cobra" Widulski <cobra@vern.cc>
This commit is contained in:
parent
9e45e98004
commit
9287e222a5
|
@ -26,7 +26,7 @@ Below is a list of values and what they do
|
|||
* `bgcolor`: Background color
|
||||
* `queue-size`: The size of the queue (minimum of 1), delays displaying bars by `queue-size` frames. Useful if desync is noticed
|
||||
* `fft`: Whether or not to perform a fourier transform to show frequencies (like `spectrum` mode in most other visualizers)
|
||||
* `fft-interpolation`: Number of points to interpolate between fft values. <1 means disable
|
||||
* `interpolation`: Number of points to interpolate between values. <1 means disable
|
||||
* `smoothing`: Smoothing mode. Possible values are:
|
||||
* `#f`: No smoothing or interpolation. Disregards `fft-interpolation`
|
||||
* `'none`: No smoothing
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
(define bgcolor #x2e2016ff)
|
||||
(define queue-size 1)
|
||||
(define fft #f)
|
||||
(define fft-interpolation 0)
|
||||
(define interpolation 0)
|
||||
(define smoothing-mode 'none)
|
||||
(define moving-average-block-size 25)
|
||||
(define exponential-factor 0.5)
|
||||
|
|
|
@ -142,7 +142,7 @@
|
|||
(define input lst)
|
||||
(define ret '())
|
||||
(define window 0)
|
||||
(if (> fft-interpolation 0)
|
||||
(if (> interpolation 0)
|
||||
;; Interpolate FFT values
|
||||
(begin
|
||||
(set! input '())
|
||||
|
@ -150,7 +150,7 @@
|
|||
((>= (1+ i) (length lst)))
|
||||
(set! input (append input (list (list-ref lst i))))
|
||||
(do ((j 0 (1+ j)))
|
||||
((> j fft-interpolation))
|
||||
((> j interpolation))
|
||||
(let ((n (- (list-ref lst (1+ i)) (list-ref lst i))))
|
||||
(set! input (append input (list (* (expt (1+ j) (/ n 100000))
|
||||
(list-ref lst i))))))))))
|
||||
|
@ -219,7 +219,10 @@
|
|||
(do-dft plan (map cadr plst)
|
||||
(length plst))))))
|
||||
;; No FFT
|
||||
(draw ren plst))))
|
||||
(if (not (equal? smoothing-mode #f))
|
||||
(draw ren (map list (smooth (map car plst) smoothing-mode)
|
||||
(smooth (map cadr plst) smoothing-mode)))
|
||||
(draw ren plst)))))
|
||||
(touch sleep-future)))
|
||||
|
||||
;; Initially open the MPD FIFO
|
||||
|
|
Loading…
Reference in New Issue