module Sound.SC3.Plot where
import qualified Graphics.Gnuplot.Simple as G
import qualified Graphics.Gnuplot.Value.Tuple as G
import Sound.SC3.Plot.Histogram
import Sound.SC3.UGen.Envelope
eps :: G.Attribute
eps = G.EPS "/tmp/plot.eps"
plotEnvelope :: (G.C t,Ord t, Floating t, Enum t) => [Envelope t] -> IO ()
plotEnvelope = G.plotLists [] . map (envelope_render 256)
plotHistogram :: G.C t => [Histogram t] -> IO ()
plotHistogram =
let f (Histogram x y) = zip x y
in G.plotLists [] . map f
type Table x = [x]
plotTable :: G.C t => [Table t] -> IO ()
plotTable = G.plotLists []
type Coord x = [(x,x)]
plotCoord :: G.C t => [Coord t] -> IO ()
plotCoord =
let s = G.defaultStyle {G.plotType = G.LinesPoints}
in G.plotPathsStyle [] . zip (repeat s)