I’m a little confused as to how I might plot two editable EnvelopeViews onto a single window so they can be edited together. I figure this is possible but the Qt GUI system has always been a challenge.
Here’s the code I’ve been playing with:
w = Window("EnvelopeView", Rect(150 , Window.screenBounds.height - 250, 1000, 500)).front;
w.view.decorator = FlowLayout(w.view.bounds);
b = EnvelopeView(w, Rect(0, 0, 995, 490))
.value_([Array.fill(10, {|i| i = i + rrand(0.01, 0.1)}).normalize,Array.fill(10, {rrand(0.001, 1.0)}).normalize ])
.grid_(Point(0.1, 0.1))
.gridOn_(true)
.drawLines_(true)
.selectionColor_(Color.red)
.drawRects_(true)
.step_(0.005)
.action_({arg b; [b.index, b.value].postln})
.thumbSize_(10)
.keepHorizontalOrder_(true);
c = EnvelopeView(w, Rect(0, 0, 995, 490))
.value_([Array.fill(10, {|i| i = i + rrand(0.01, 0.1)}).normalize,Array.fill(10, {rrand(0.001, 1.0)}).normalize ])
.grid_(Point(0.1, 0.1))
.gridOn_(true)
.drawLines_(true)
.selectionColor_(Color.red)
.drawRects_(true)
.step_(0.005)
.action_({arg b; [b.index, b.value].postln})
.thumbSize_(10)
.keepHorizontalOrder_(true);
w.front;
I basically want both b
and c
on the same window. What’s the best way to go about this?