Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions HelpSource/Classes/ScatterView.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,10 @@ PRIVATE:: initPlot
EXAMPLES::

code::
// you may want to use Swing or Cocoa
SwingOSC.default.boot
GUI.swing


(
var data = 1000.collect{ [1.0.rand, exprand(0.01, 1)]};
w = GUI.window.new(bounds: Rect(40, 40, 800, 800)).front;
w = Window.new(bounds: Rect(40, 40, 800, 800)).front;
a = ScatterView(w, Rect(10, 10, 760, 760), data, [0,1].asSpec, [0,1].asSpec);
a.drawAxis_(true).drawMethod_(\fillOval)
.symbolColor_(Color.blue(0.5, 0.5)).symbolSize_(5)
Expand All @@ -108,10 +104,10 @@ a.drawAxis_(true).drawMethod_(\fillOval)

(
var numItems = 630;
w = GUI.window.new(bounds: Rect(40, 40, 800, 150)).front;
w = Window.new(bounds: Rect(40, 40, 800, 150)).front;
a = ScatterView(w, Rect(10, 10, 760, 100), {|i| [sin(i/50), sin(0.05*i)]}!numItems, [-1,1].asSpec, [-1,1].asSpec);
a.isHighlight = true;
GUI.slider.new(w, Rect(10, 120, 760, 20)).action_{|me|
Slider.new(w, Rect(10, 120, 760, 20)).action_{|me|
a.highlightItemRel = me.value;
a.refresh;
// a.highlightItem = (me.value*numItems).asInteger.min(numItems-1);
Expand Down Expand Up @@ -176,12 +172,13 @@ w.refresh
// use two views stacked
(
var numItems = 630;
w = SCWindow.new(bounds: Rect(40, 40, 800, 150)).front;
w = Window.new(bounds: Rect(40, 40, 800, 150)).front;
a = ScatterView(w, Rect(10, 10, 760, 100), {|i| [sin(i/50), sin(0.05*i)]}!numItems, [-1,1].asSpec, [-1,1].asSpec);
b = ScatterView(w, Rect(10, 10, 760, 100), {|i| [sin(i/21), sin(0.05*i)]}!numItems, [-1,1].asSpec, [-1,1].asSpec);
a.background = Color.gray(0, 0);
b.background = Color.clear;
a.isHighlight = true;
SCSlider(w, Rect(10, 120, 760, 10)).action_{|me|
Slider(w, Rect(10, 120, 760, 10)).action_{|me|
a.highlightItemRel = me.value;
w.refresh;
//a.highlightItem = (me.value*numItems).asInteger.min(numItems-1);
Expand All @@ -197,10 +194,10 @@ w.refresh;

(
var numItems = 630;
w = SCWindow.new(bounds: Rect(40, 40, 800, 150)).front;
w = Window.new(bounds: Rect(40, 40, 800, 150)).front;
a = ScatterView(w, Rect(10, 10, 760, 100), {|i| [sin(i/50), sin(0.05*i)]}!numItems, [-1,1].asSpec, [-1,1].asSpec);
a.isHighlight = true;
SCRangeSlider(w, Rect(10, 120, 760, 10)).action_{|me|
RangeSlider(w, Rect(10, 120, 760, 10)).action_{|me|
a.highlightRangeRel(me.lo, me.hi);
w.refresh;
// a.highlightItem = (me.value*numItems).asInteger.min(numItems-1);
Expand Down
2 changes: 1 addition & 1 deletion HelpSource/Classes/ScatterView2.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ code::
// three dimensional dataset
d = ({1.0.rand}!9000).clump(3);

w = SCWindow.new("ScatterView Example");
w = Window.new("ScatterView Example");
v = ScatterView2(w, Rect(10, 10, 380, 380), d);
v.selectionMode = \nextNeighbour;
v.background = Color.black;
Expand Down
10 changes: 5 additions & 5 deletions HelpSource/Guides/rewriteString.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ SynthDef("sinegrain",
var env;
env = EnvGen.kr(Env.perc(0.01, dur, 0.2), doneAction:2);
Out.ar(out, SinOsc.ar(freq, 0, env))
}).memStore;
}).add;
)


Expand Down Expand Up @@ -445,18 +445,18 @@ k.asStream.rewriteString(c, 6).all.join.postcs; // "bbbbbbab"
(
var w, b, u, f, z, level=0;

w = SCWindow("test", Rect(40, 240, 200, 200)).front;
w = Window("test", Rect(40, 240, 200, 200)).front;
w.view.decorator = FlowLayout(w.bounds.copy.left_(30).top_(30));
b = { |i| { |j|
var c = ({ "abcd".choose } ! 3).join;
SCButton(w, Rect(0,0, 30,25))
Button(w, Rect(0,0, 30,25))
.states_([[c, Color.black]])
.action_({ f.(c) })
.font_(Font(\Georgia, 11))
} ! 4; w.view.decorator.nextLine } ! 4;

w.view.decorator.nextLine;
SCButton(w, Rect(0,0, 30,25))
Button(w, Rect(0,0, 30,25))
.states_({ |i| [i.asString, Color.black]} ! 16)
.action_({ |b| level = b.value });

Expand All @@ -474,7 +474,7 @@ SynthDef(\p, { |out = 0, freq=400, amp=0.4, sustain=0.04|
SinOsc.ar(freq)
* XLine.ar(amp, amp * 0.001, sustain, doneAction: 2)
);
}).memStore;
}).add;
);

u = { |str|
Expand Down
Loading