hi, i need to create a lot of instances (let's say 3000) of a gem abstraction. each instance has to hold it's own variables, so it is difficult to work with repeat. In the past I always used pd-messages to create these objects, but I have the feeling that it would be faster and easier to do in a scripting language like lua. are there any plans to support scripting of pd objects (in this case gem objects) within lua or any other scripting language? marius.
Sounds like a good time for [nqpoly4]. I have used it to manage 1000
instances of one abstraction and more than that for multiple
abstractions. Check the included Gem example for nqpoly4.
.hc
On Apr 10, 2008, at 12:10 PM, marius schebella wrote:
hi, i need to create a lot of instances (let's say 3000) of a gem abstraction. each instance has to hold it's own variables, so it is difficult to work with repeat. In the past I always used pd-messages to create these objects, but I have the feeling that it would be faster and easier to do in a
scripting language like lua. are there any plans to support scripting of pd objects (in this
case gem objects) within lua or any other scripting language? marius.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
Using ReBirth is like trying to play an 808 with a long stick. - David Zicarelli
well, nqpoly4 asks for a very special method to write your abstraction, and I wonder if there is an overhead from additional send/receives? besides, I will try it, never used it before, thanks. marius.
Hans-Christoph Steiner wrote:
Sounds like a good time for [nqpoly4]. I have used it to manage 1000 instances of one abstraction and more than that for multiple abstractions. Check the included Gem example for nqpoly4.
.hc
On Apr 10, 2008, at 12:10 PM, marius schebella wrote:
hi, i need to create a lot of instances (let's say 3000) of a gem abstraction. each instance has to hold it's own variables, so it is difficult to work with repeat. In the past I always used pd-messages to create these objects, but I have the feeling that it would be faster and easier to do in a scripting language like lua. are there any plans to support scripting of pd objects (in this case gem objects) within lua or any other scripting language? marius.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Using ReBirth is like trying to play an 808 with a long stick. -David Zicarelli
Hallo, marius schebella hat gesagt: // marius schebella wrote:
well, nqpoly4 asks for a very special method to write your abstraction,
That's only because it's a generic helper for dynamic patching. You could of course also just do your dynamic patching the traditional way.
and I wonder if there is an overhead from additional send/receives?
There are no additional sends and receives in nqpoly4: It handles messaging from the outside through direct connections with in/outlets. I doubt that it makes much of a differnce anyway.
An alternative with Lua might be to write "polyphonic" pdlua objects. A quick example is attached simple [linebuffer] which just draws many [curve 2]-like lines with optional aging. It can easily handle several thousands of lines. (Requires luagl, rename suffix for newest pdlua)
Frank Barknecht _ ______footils.org__
marius schebella wrote:
are there any plans to support scripting of pd objects (in this case gem objects) within lua or any other scripting language?
Support already exists to the same level that it does in Pd.
You can use pd.send(name, sel, atoms) to send to subpatch's receiver. (I think, best check the examples for exact syntax.)
Whether it would be useful to have a library of functions to make it easier, I don't know.
Hi Marius,
i've used py and dyn~ in combination for such stuff many times.
With that many objects it makes probably sense to put the
abstractions in subpatches (e.g. 30 subpatches with 100 objects each)
as pd has problems with many objects in one canvas.
gr~~~
Am 10.04.2008 um 18:10 schrieb marius schebella:
hi, i need to create a lot of instances (let's say 3000) of a gem abstraction. each instance has to hold it's own variables, so it is difficult to work with repeat. In the past I always used pd-messages to create these objects, but I have the feeling that it would be faster and easier to do in a
scripting language like lua. are there any plans to support scripting of pd objects (in this
case gem objects) within lua or any other scripting language? marius.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
thanks for all the answers, I guess I am really looking for something like actionscript for pd, based on lua or python. I understand that all of the suggested solutions are working, but all have some minor downsides, or overheads (of coding) or dynamic restrictions. marius.
Thomas Grill wrote:
Hi Marius, i've used py and dyn~ in combination for such stuff many times. With that many objects it makes probably sense to put the abstractions in subpatches (e.g. 30 subpatches with 100 objects each) as pd has problems with many objects in one canvas. gr~~~
Am 10.04.2008 um 18:10 schrieb marius schebella:
hi, i need to create a lot of instances (let's say 3000) of a gem abstraction. each instance has to hold it's own variables, so it is difficult to work with repeat. In the past I always used pd-messages to create these objects, but I have the feeling that it would be faster and easier to do in a scripting language like lua. are there any plans to support scripting of pd objects (in this case gem objects) within lua or any other scripting language? marius.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
hi marius
sorry to switch in so late, but let me mention another approach. if you only have numeric arguments for your abstractions, you could alternatively still use [repeat] and read the different values from a/several table/s. that is what i usually do, when i need - let's say - 1000 cuboids at different positions with different colours. like this you wouldn't need thousands of instances of a certain abstraction, but only one, where you send thousands of messages to for each frame.
don't know, if this would work for what you want, though...
roman
On Thu, 2008-04-10 at 13:47 -0400, marius schebella wrote:
thanks for all the answers, I guess I am really looking for something like actionscript for pd, based on lua or python. I understand that all of the suggested solutions are working, but all have some minor downsides, or overheads (of coding) or dynamic restrictions. marius.
Thomas Grill wrote:
Hi Marius, i've used py and dyn~ in combination for such stuff many times. With that many objects it makes probably sense to put the abstractions in subpatches (e.g. 30 subpatches with 100 objects each) as pd has problems with many objects in one canvas. gr~~~
Am 10.04.2008 um 18:10 schrieb marius schebella:
hi, i need to create a lot of instances (let's say 3000) of a gem abstraction. each instance has to hold it's own variables, so it is difficult to work with repeat. In the past I always used pd-messages to create these objects, but I have the feeling that it would be faster and easier to do in a scripting language like lua. are there any plans to support scripting of pd objects (in this case gem objects) within lua or any other scripting language? marius.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
___________________________________________________________ Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de
I tried that too, with a set of new patches and it was quite fast (although I think not as fast as luagl), but I already have a lot of old interactive object patches that I wanted to use. they have mouseover handling and also store textinformation. actually it is a question of performance. I want as many as possible objects and need to find the fastest solution. marius.
Roman Haefeli wrote:
hi marius
sorry to switch in so late, but let me mention another approach. if you only have numeric arguments for your abstractions, you could alternatively still use [repeat] and read the different values from a/several table/s. that is what i usually do, when i need - let's say - 1000 cuboids at different positions with different colours. like this you wouldn't need thousands of instances of a certain abstraction, but only one, where you send thousands of messages to for each frame.
don't know, if this would work for what you want, though...
roman
On Thu, 2008-04-10 at 13:47 -0400, marius schebella wrote:
thanks for all the answers, I guess I am really looking for something like actionscript for pd, based on lua or python. I understand that all of the suggested solutions are working, but all have some minor downsides, or overheads (of coding) or dynamic restrictions. marius.
Thomas Grill wrote:
Hi Marius, i've used py and dyn~ in combination for such stuff many times. With that many objects it makes probably sense to put the abstractions in subpatches (e.g. 30 subpatches with 100 objects each) as pd has problems with many objects in one canvas. gr~~~
Am 10.04.2008 um 18:10 schrieb marius schebella:
hi, i need to create a lot of instances (let's say 3000) of a gem abstraction. each instance has to hold it's own variables, so it is difficult to work with repeat. In the past I always used pd-messages to create these objects, but I have the feeling that it would be faster and easier to do in a scripting language like lua. are there any plans to support scripting of pd objects (in this case gem objects) within lua or any other scripting language? marius.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
___________________________________________________________ Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de
In GEM if you need lots of objects then try to avoid using a gemhead or separator for each. The setup time for pushing and popping the matrix thousands of times starts to add up.
Also, use a model so rather than compute and upload the geometry in immediate mode each frame a display list is called instead.
The fastest solution would be to write a custom object that wraps all of the functionality you need.
On Fri, Apr 11, 2008 at 10:46 AM, marius schebella < marius.schebella@gmail.com> wrote:
I tried that too, with a set of new patches and it was quite fast (although I think not as fast as luagl), but I already have a lot of old interactive object patches that I wanted to use. they have mouseover handling and also store textinformation. actually it is a question of performance. I want as many as possible objects and need to find the fastest solution. marius.
chris clepper wrote:
In GEM if you need lots of objects then try to avoid using a gemhead or separator for each. The setup time for pushing and popping the matrix thousands of times starts to add up.
I don't know how I could translate the objects correctly without gemheads or separators, maybe storing the current XYZlocation and subtracting it from the relative position? would that be faster than to use pushmatrix popmatrix?
Also, use a model so rather than compute and upload the geometry in immediate mode each frame a display list is called instead.
the geometry I was using so far was simple, but objects could still be faster I guess. are you talking about display lists like VOBs or FBOs? I have to read more about that and how gem makes use of it.
The fastest solution would be to write a custom object that wraps all of the functionality you need.
write as write in c++? or write as write in luagl?
marius.
On Fri, Apr 11, 2008 at 10:46 AM, marius schebella <marius.schebella@gmail.com mailto:marius.schebella@gmail.com> wrote:
I tried that too, with a set of new patches and it was quite fast (although I think not as fast as luagl), but I already have a lot of old interactive object patches that I wanted to use. they have mouseover handling and also store textinformation. actually it is a question of performance. I want as many as possible objects and need to find the fastest solution. marius.
On Fri, Apr 11, 2008 at 11:43 AM, marius schebella < marius.schebella@gmail.com> wrote:
I don't know how I could translate the objects correctly without gemheads or separators, maybe storing the current XYZlocation and subtracting it from the relative position? would that be faster than to use pushmatrix popmatrix?
For something like a grid this is not difficult to do, but for less uniform structures it would be a pain.
Pushing and popping the matrix is not expensive done sparingly, but it does accumulate. Once the geometry count gets high you will need all the time you can get.
the geometry I was using so far was simple, but objects could still be faster I guess. are you talking about display lists like VOBs or FBOs? I have to read more about that and how gem makes use of it.
A display list is the geometry compiled and sent to the card once and then called from storage on the GPU for drawing. The model object uses display lists to help handle large numbers of triangles found in most models.
VBO is a vertex buffer object which can be quite fast if you need to modify geometry on the CPU side and submit it to the GPU each frame.
FBO is a way to render offscreen to use rasterized geometry as a texture in another framebuffer (usually the one drawn to screen). FBOs will probably not help you here.
write as write in c++? or write as write in luagl?
C++ - Jamie did a lot of this for his personal use.
I have not used luagl, but I suspect it will not be comparable to C in speed.
cgc
Hallo, chris clepper hat gesagt: // chris clepper wrote:
C++ - Jamie did a lot of this for his personal use.
I have not used luagl, but I suspect it will not be comparable to C in speed.
luagl is not as fast as C, but it's already much faster than using lots of separators or double gemheads.
Regarding Gem-externals: Does anyone have a simple template project how to write and compile a custom Gem external? This could be very useful, but I'm a bit confused how to do this in a simple way.
Frank Barknecht _ ______footils.org__
hello,
Frank Barknecht a écrit :
Hallo, chris clepper hat gesagt: // chris clepper wrote:
C++ - Jamie did a lot of this for his personal use.
I have not used luagl, but I suspect it will not be comparable to C in speed.
luagl is not as fast as C, but it's already much faster than using lots of separators or double gemheads.
Regarding Gem-externals: Does anyone have a simple template project how to write and compile a custom Gem external? This could be very useful, but I'm a bit confused how to do this in a simple way.
use a gem object (like cube). search and replace "cube" by the name of your object in both the ccp and h file. use this makefile (adjust the name of the file / src directory). it should compile.
cyrille
Ciao
PD_DIR = /home/nusmuk/pd/pd/src GEM_DIR = /home/nusmuk/pd/Gem/src
LIBS = -lm
# build flags
INCLUDE = -I$(PD_DIR) -I. -I$(GEM_DIR) -I$(PD_DIR)
CPPFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer -ffast-math
-Wall -W -Wno-unused -Wno-parentheses -Wno-switch -g
all: test.pd_linux rm -f *.o
.SUFFIXES: .pd_linux
clean: rm -f *.o rm -f *.pd_linux
.cpp.o: g++ $(CPPFLAGS) $(INCLUDE) -o $*.o -c $*.cpp
.cpp.pd_linux: g++ $(CPPFLAGS) $(INCLUDE) -o $*.o -c $*.cpp gcc -export_dynamic -shared -o $*.pd_linux $*.o $(LIBS) rm -f *.o
Hallo, cyrille henry hat gesagt: // cyrille henry wrote:
luagl is not as fast as C, but it's already much faster than using lots of separators or double gemheads.
Regarding Gem-externals: Does anyone have a simple template project how to write and compile a custom Gem external? This could be very useful, but I'm a bit confused how to do this in a simple way.
use a gem object (like cube). search and replace "cube" by the name of your object in both the ccp and h file. use this makefile (adjust the name of the file / src directory). it should compile.
Thanks a lot Cyrille. I made a little "benchmark" of a [linebuffer] object in luagl vs. a quickly hacked C++ version (warning, very ugly code!! Includes bugs I didn't care to fix for now.)
In this case, Lua does compare quite well with the C++ version on my machine.
Frank Barknecht _ ______footils.org__
Hi,
i really have next to no GEM knowledge, but i was always asking
myself whether GEM compiles the GL commands to display lists.
If yes, is that structured by using separate gemheads, if no, why
isn't it used?
If display lists are used i would think it shouldn't make a lot of
difference which language is used for the GL commands (apart from
changing parameters maybe).
gr~~~
Am 13.04.2008 um 16:38 schrieb Frank Barknecht:
Hallo, cyrille henry hat gesagt: // cyrille henry wrote:
luagl is not as fast as C, but it's already much faster than using lots of separators or double gemheads.
Regarding Gem-externals: Does anyone have a simple template project how to write and compile a custom Gem external? This could be very useful, but I'm a bit confused how to do this in a simple way.
use a gem object (like cube). search and replace "cube" by the name of your object in both the
ccp and h file. use this makefile (adjust the name of the file / src directory). it should compile.Thanks a lot Cyrille. I made a little "benchmark" of a [linebuffer] object in luagl vs. a quickly hacked C++ version (warning, very ugly code!! Includes bugs I didn't care to fix for now.)
In this case, Lua does compare quite well with the C++ version on my machine.
Ciao
Frank Barknecht _
______footils.org__<lua-c- gemtest.tgz>_______________________________________________ PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
A display list is useful for static geometry which is why it makes sense for the model object. It does not make much sense for the Geos that allow the changing of the vertex data (sphere, cylinder, etc) since the compiling of the list has to be done for each change which adds overhead.
I think someone did make an example of building a display list per gemhead and then calling the list for rendering in another.
On Sun, Apr 13, 2008 at 11:40 AM, Thomas Grill gr@grrrr.org wrote:
Hi, i really have next to no GEM knowledge, but i was always asking myself whether GEM compiles the GL commands to display lists. If yes, is that structured by using separate gemheads, if no, why isn't it used? If display lists are used i would think it shouldn't make a lot of difference which language is used for the GL commands (apart from changing parameters maybe). gr~~~
Am 13.04.2008 um 16:38 schrieb Frank Barknecht:
Hallo, cyrille henry hat gesagt: // cyrille henry wrote:
luagl is not as fast as C, but it's already much faster than using lots of separators or double gemheads.
Regarding Gem-externals: Does anyone have a simple template project how to write and compile a custom Gem external? This could be very useful, but I'm a bit confused how to do this in a simple way.
use a gem object (like cube). search and replace "cube" by the name of your object in both the ccp and h file. use this makefile (adjust the name of the file / src directory). it should compile.
Thanks a lot Cyrille. I made a little "benchmark" of a [linebuffer] object in luagl vs. a quickly hacked C++ version (warning, very ugly code!! Includes bugs I didn't care to fix for now.)
In this case, Lua does compare quite well with the C++ version on my machine.
Ciao
Frank Barknecht _ ______footils.org__<lua-c- gemtest.tgz>_______________________________________________ PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
chris clepper wrote:
I think someone did make an example of building a display list per gemhead and then calling the list for rendering in another.
i guess you mean the one i mentioned earlier, which can be found in examples/09.openGL/
mfgas IOhannes
hello frank, not sure how to compare. the lua code fades the lines out, but the c++ object does not. I can create 100000 lines in lbuff and still only get 34% cpu use. with lua and aging 0 I can only have about 17000 lines. marius.
Frank Barknecht wrote:
Hallo, cyrille henry hat gesagt: // cyrille henry wrote:
luagl is not as fast as C, but it's already much faster than using lots of separators or double gemheads.
Regarding Gem-externals: Does anyone have a simple template project how to write and compile a custom Gem external? This could be very useful, but I'm a bit confused how to do this in a simple way.
use a gem object (like cube). search and replace "cube" by the name of your object in both the ccp and h file. use this makefile (adjust the name of the file / src directory). it should compile.
Thanks a lot Cyrille. I made a little "benchmark" of a [linebuffer] object in luagl vs. a quickly hacked C++ version (warning, very ugly code!! Includes bugs I didn't care to fix for now.)
In this case, Lua does compare quite well with the C++ version on my machine.
Ciao
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list