How do i draw an accurate parametric eq curve given gain, freq, and q?

2.2k views Asked by At

After a lot of googling I still can't find an equation to give me the path I need. I am creating a gui for a parametric eq and just can't get the curve drawing to look or feel accurate. Although I know most eq plugins are just eye candy giving a representation of the actual audio processing, I stil want it be at least as accurate as what is out there.

I have tried using a single CubicCurve2D and also a pair of QuadCurves. It has become clear that using these is not going to do what I want and I will need to just use the actual equation and create a path.

I am doing the project in clojure so if anyone can give an example of how I might plot the x y coords given gain, freq, and q, or even just a generic equation to do so in any language would be a huge help

thanks

1

There are 1 answers

1
mikera On

Incanter is a great tool for doing chart plotting in Clojure.

Here's a simple parametric xy-plot:

(ns incantertest
  (:use [incanter core stats charts]))

(let [points (map 
               (fn [t]
                 (let [t (double t)]
                   [(+ (Math/sin (* t 0.01)) (Math/sin (* t 0.08))) 
                    (+ (Math/cos (* t 0.2)) (Math/sin (* t 0.13)))]))
               (range 1000))
         xs (map first points)
         ys (map second points)]
     (view (incanter.charts/xy-plot xs ys)))

Which produces something like:

parametric plot