First time here? Check out the FAQ!

optimize graphics in VCS and Tool

0 votes
Hello, our cellular automata Tool is working great, however, when we make our Arrays larger, the Tool Graphics and VCS freeze up for about 5-10 seconds. Do you have any advice about how to optimize the graphics and tool so the UI remains functional?


asked Jul 25, 2015 in Capytalk & Smalltalk by kristin-grace-erickson (180 points)
What are the dimensions of your Array?
we are trying different dimensions. I'd like to go big. Currently running a 16x16x16...
Are there 4096 EventValues (controllers) in your Kyma Sound? (16X16X16)  Or are you using a subset from the matrix (and if so, what is the subset)?
256, as I use the 3rd dimension to store future values...
16 voices, 16 steps, but I am also using 2 arrays - one for !gates and one for !frequencies

2 Answers

+1 vote
Best answer
First thing I would try is to eliminate the text display of the 3d Array in the Tool (it is not all that helpful since you can see it in the VCS buttons in any case).  Try commenting out the line:

SpaceString := Space printString.

You could also try reducing the time dimension to 4, just enough cells to calculate the next generation, rather than 16 into the future.  That would reduce your array size to 16X16X4.  So your update step would be something like:

0 to: 15 do: [:i |

   0 to: 15 do: [:j |

     0 to: 3 do: [:k | ]]]

And of course change the inner loops to:

((i - 1) max: 0) to: ((i + 1) min: 15) do: [:ni |

   ((j - 1) max: 0) to: ((j + 1) min: 15) do: [:nj |

      ((k - 1) max: 0) to: ((k + 1) min: 3) do: [:nk |


Updating the entire cube at once is an Order n-cubed computation, so when you increase the size from 8 to 16, it is increasing the computational cost from 8 cubed (512) to 16 cubed = (4096) times the number of operations in the inner loop.  So another option is to figure out a way to update the cube incrementally rather than doing the entire thing at once.
answered Jul 25, 2015 by ssc (Savant) (120,590 points)
selected Jul 26, 2015 by kristin-grace-erickson
That makes sense. I will try to work in smaller chunks.

I was getting a "This sound has too many widgets to be controlled by Kyma Control"  --- Now I'm wondering if I need to have a graphic widget for every gate.

Could it be more efficient to somehow store the 2D arrays in an audio file, like a collection of pulse code control gates? Is there an object for this purpose?

See the other answer for an optimized version of the tool that can run at the full 16x16x16.
0 votes

Here's a more optimized version of the tool that runs almost as fast for a 16x16x16 as the original did at 5x5x5.  It constructs all the EventValue names in the initial state so it does not have to do it on every loop.

answered Jul 26, 2015 by ssc (Savant) (120,590 points)