Bass Tilt Plug-in

Cool, it works well :sunglasses:

If I could make a couple of suggestions:

The extra line spaces in the header should not really be there. David Sky, who wrote the plug-in that you were copying, was blind, and so was unaware of the double line spacing. Nyquist is based on LISP, and in well written LISP the code is spaced out no more than necessary, keeping related code together and separating unrelated blocks with a small space. Indentation is used a lot to indicate the code structure. Indentation is important for readability in LISP, otherwise it’s far too easy to get lost in a forest of brackets :wink:

If you plan to do more with Nyquist, there is a guide to LISP indentation here:
I’ve also posted a few examples here:
Unlike the Python language, indentation is not part of the syntax in LISP, so Nyquist code will still run even if the indentation is hopelessly wrong, but it will be horrible to read.

I’d also highly recommend using a text editor that has “bracket matching” (automatically highlights the matching bracket when one bracket is selected). If you’re on Windows, NotePad++ is very good (and free).

How I would lay out your code would be like this:

;nyquist plug-in
;version 1
;type process
;name "Bass Tilt"
;action "Equalizing..."
;info "Bass Tilt"

;control tilt "Warmth" real "db" 15 0 100

(mult (/ (db-to-linear tilt)))
    (eq-lowshelf s 250 tilt 0.4)
    4000 (- tilt) 0.4)

The other thing that I noticed is that a slope from +100 dB to -100 dB is rather excessive (I can’t imagine many uses over, say about 20 dB), and more than the simple “gain compensation” can cope with.

We can improve the gain compensation by applying a compensation of 2/tilt dB to the sound before filtering.
A couple of different examples of how that might be coded:

; scale "s" before filtering
(setf s (mult s (/ 2.0 (db-to-linear tilt))))

  (eq-lowshelf s 250 tilt 0.4)
  4000 (- tilt) 0.4)

or scale “S” within a “Let” block

(let ((s (mult s (/ 2.0 (db-to-linear tilt)))))
    (eq-lowshelf s 250 tilt 0.4)
    4000 (- tilt) 0.4))