«some GNUPlot quark examples» by Fredrik Olofsson

on 18 Jun'13 20:14 in plot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
to make it work on osx 10.12 (need homebrew installed)...
* in sc run: Quarks.install("GNUPlot")
* recompile sc
* in terminal run: brew install gnuplot --with-qt

s.boot
GNUPlot.initCode="set term qt\n";
g= GNUPlot.new;
{SinOsc.ar([42, 83, 164])}.loadToFloatArray(0.1, s, {|arr| g.plot3(arr.clump(3), "three lfo for 0.1sec")})
{SinOsc.ar([42, 83, 164])}.loadToFloatArray(0.05, s, {|arr| g.surf3([arr.clump(3), (1-arr.clump(3)).cos], pm3d:true)})
{SinOsc.ar([42, 83, 164])}.loadToFloatArray(0.0125, s, {|arr| g.surf3([arr.clump(3), arr.clump(3).reverse], hidden3d:false, pm3d:false)})

//plot a buffer - takes a few seconds
b= Buffer.read(s, Platform.resourceDir+/+"sounds/a11wlk01.wav");
{[LFSaw.ar(1).range(0, b.duration), 0, PlayBuf.ar(1, b)]}.loadToFloatArray(b.duration, s, {|arr| g.plot3(arr.clump(3))})
b.free
g.stop

g= GNUPlot.new;
g.monitor({sin(Main.elapsedTime)}, 0.1, 100, 1 ); 
g.startMonitor;
g.stopMonitor;
g.stop;
raw 951 chars (focus & ctrl+a+c to copy)
reception
comments