2

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

Jon Rose
  • 1,457
  • 1
  • 15
  • 25

1 Answers1

4

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

mikera
  • 105,238
  • 25
  • 256
  • 415
  • this is awesome. Thanks a lot I hadn't seen incanter yet. So I pretty much understand what is going on. Your t value, which is created by the range function, would be like my frquency i think. What about 'q' and gain? Sorry, my math skills are pretty weak. thanks again – Jon Rose Jan 20 '12 at 16:42