Discussion:
Drawing grid and other graphs on top of FreqScope or FreqScopeView
Pawle
2014-09-17 12:23:01 UTC
Permalink
Hello list
Is it possible to put a FreqScopeView or FreqScope on a UserView and then
draw on it with Pen. I would like to have the spectre being drawn in
realtime an then have some lines drawn on top of it. I know how to use
FreqScope and Pen, but I dont know how to put them together.
--
BlaÅŸ Pavlica
felix
2014-09-17 14:30:11 UTC
Permalink
DrawGrid will do that for you. See the help file.

this will draw on a UserView. put it on top of the FreqScopeView (same
bounds)

and set the background color to transparent and you should see the scope
behind the lines


(
w = Window.new.front;
u = UserView(w,Rect(20,20,300,300));
// the Spec can define its preferred grid system
x = \freq.asSpec.grid;
y = \amp.asSpec.grid;
d = DrawGrid(Rect(0,0,500,300), x,y);

u.drawFunc = {
d.draw
};
)
Post by Pawle
Hello list
Is it possible to put a FreqScopeView or FreqScope on a UserView and then
draw on it with Pen. I would like to have the spectre being drawn in
realtime an then have some lines drawn on top of it. I know how to use
FreqScope and Pen, but I dont know how to put them together.
--
BlaÅŸ Pavlica
--
..
http://soundcloud.com/crucialfelix
http://github.com/crucialfelix
.
Pawle
2014-09-17 16:39:44 UTC
Permalink
Oh so simple, I've made the mistake of putting the freqscope in the
userView. Thank you.
Post by felix
DrawGrid will do that for you. See the help file.
this will draw on a UserView. put it on top of the FreqScopeView (same
bounds)
and set the background color to transparent and you should see the scope
behind the lines
(
w = Window.new.front;
u = UserView(w,Rect(20,20,300,300));
// the Spec can define its preferred grid system
x = \freq.asSpec.grid;
y = \amp.asSpec.grid;
d = DrawGrid(Rect(0,0,500,300), x,y);
u.drawFunc = {
d.draw
};
)
Post by Pawle
Hello list
Is it possible to put a FreqScopeView or FreqScope on a UserView and then
draw on it with Pen. I would like to have the spectre being drawn in
realtime an then have some lines drawn on top of it. I know how to use
FreqScope and Pen, but I dont know how to put them together.
--
BlaÅŸ Pavlica
--
..
http://soundcloud.com/crucialfelix
http://github.com/crucialfelix
.
--
BlaÅŸ Pavlica
felix
2014-09-17 20:46:38 UTC
Permalink
its a useful trick to stack views on top of each other.

the only issue is that the top most one will get the clicks.
Post by Pawle
Oh so simple, I've made the mistake of putting the freqscope in the
userView. Thank you.
Post by felix
DrawGrid will do that for you. See the help file.
this will draw on a UserView. put it on top of the FreqScopeView (same
bounds)
and set the background color to transparent and you should see the scope
behind the lines
(
w = Window.new.front;
u = UserView(w,Rect(20,20,300,300));
// the Spec can define its preferred grid system
x = \freq.asSpec.grid;
y = \amp.asSpec.grid;
d = DrawGrid(Rect(0,0,500,300), x,y);
u.drawFunc = {
d.draw
};
)
Post by Pawle
Hello list
Is it possible to put a FreqScopeView or FreqScope on a UserView and
then draw on it with Pen. I would like to have the spectre being drawn in
realtime an then have some lines drawn on top of it. I know how to use
FreqScope and Pen, but I dont know how to put them together.
--
BlaÅŸ Pavlica
--
..
http://soundcloud.com/crucialfelix
http://github.com/crucialfelix
.
--
BlaÅŸ Pavlica
--
..
http://soundcloud.com/crucialfelix
http://github.com/crucialfelix
.
Loading...