All pastes #2096219 Raw Edit

Stuff

public text v1 · immutable
#2096219 ·published 2011-12-25 07:08 UTC
rendered paste body
function learners(numLearners, toLearn)
{

    if(arguments.length) // bail if no arguments
    {
        // parse arguments
        a = arguments[0];
        b = arguments[1];

        // safety check for number of sliders
        if(a<0) a = 0; // too few sliders, set to 0 
        if(a>128) a = 128; // too many sliders, set to 128

        // out with the old...
        for(i=0;i<numLearners;i++) // get rid of the ctlin and uslider objects using the old number of sliders
        {
            this.patcher.remove(theLearners[i]);
        }

        // ...in with the new
        numLearners = a; // update our global number of sliders to the new value
        for(k=0;k<a;k++) // create the new ctlin and uslider objects, connect them to one another and to the funnel
        {
            
	      Learners[k] = this.patcher.newdefault(300+(k*100), 50, "cv.jit.learn" + b);
//            this.patcher.connect(controlin[k], 0, thesliders[k], 0);
//            this.patcher.connect(thesliders[k], 0, thefunnel, k);
        }