On Jul 26, 2009, at 3:11 PM, Miguel Negrao wrote:
Hi
The last two months I've been working on management system for a
preset system based on SenseWorld's quark ParameterSpace class* and on
the ixi quark ParaSpace gui. The objective is to make it easy to
assign Synth's arguments to a particular preset in a 2D space.
The logical organizataion is through Collections. Each Collection is
a 2D space where presets can be saved. At setup time a group of synths
is connected to the system, the arguments of the synths can then be
assigned to any of the collections, and new collections can be created
and deleted through the gui. The position of the preset in the 2D
space and of the cursor can be changed by dragging in the Gui.
There is also a system to make movements through the space. These can
be of 3 types, a recorded movement (using ParaPath, which is a copy
from the trajectory class of the WFS system, thanks Wouter !!), a
movement defined by a math equation (e.g. (x,y) =
(cos(2pift),sin(2pift) ) or a movement defined by a differential
equation.
I created a Solver class for solving systems of ordinary differential
equations of any order. The solving method can be choosen, altough I
default on Runge-Kutta order 4 since it's the most widelly used and
recommended in the literature. This class is quite independent of
everything else to it can be used for anything really (simulate
springs, pendulums, chaotic systems, etc)
Although the lib is basically working, I'm having lots of problems
with performance/cpu issues. Since I have been basically stuck for the
moment I decided to release the code here, even if there is probably
one or two bugs still, in the hope that someone can figure out what I
can do to solve this.
Basically I'm getting huge cpu usage whenever the number of synths and
parameters tracked increases. this comes from 3 places, the gui
refresh, the physical simulation calculations and the interpolation
calculations.
About the screen refresh there's not much that can be done inside sc,
and that is more a less under control (10% - 15%). the other two cpu
sources easilly get out of control. With something like 20 synths,
with 20 parameters each sc just blows up with 100% cpu usage. The
calculations don't seem complicated to me, and I'm sure they are tiny
compared to what is going inside a synth in the server. So my question
is, what is causing this cpu usage ?
1 - My code is not well written and is not optimized.
2 - I have hit the limit of what the sc language environment can do in
terms of heavy calculation stuff.
The solutions I can see are not very nice. One would be to rewrite
everything in c++, for example with OpenFrameworks for nice visuals
and contact with sc via osc. I could also write everything as language
plugin, using the new system released recently. finally I though of
implementing the calculations with a synth running in the server at
control rate with a lot of outputs (one per parameter per synth) and
then connecting those outputs to the correct synth.
the first two options are not really options for me, because I'm very
amateur at writing c++ code, I can compare code and change this or
that, but I can't really write something like this from scratch. So
this leaves me with the third option. Any other suggestions ?
pic: http://www.friendlyvirus.org/files/Imagem%203.png
code: http://www.friendlyvirus.org/files/MultiParameterSpaceEditor.zip
there's an rtf file with an example.
cheers,
--
Miguel Negrão // ZLB
http://www.friendlyvirus.org/artists/zlb/
* Basically I copied the entire class and adapted it such that
everything is an array, so that it becomes easy to track several
synths at the same time.
This lib uses adapts code from SenseWorld's ParametricSpace class,
from the ParaSpace gui from ixi Quarks and from the WFS library
WFSPath class from Wouter Snoei. Thanks !!
_______________________________________________
sc-users mailing list
info (subscription, etc.):
http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/
_______________________________________________
sc-users mailing list
info (subscription, etc.):
http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/