Wavesets Task of a Task

Hello, rookie both on Task and Wavesets, I have this question: Here I have a movement that I would like to loop: the 3154.do correspond to the number of Xings of the loaded sound file playing its full content and I want to keep it. My point here would be to be able to loop this task of 3154.do and being able to have a new layout of randomisation of the wavesets arg: the first one is already in this 3154.do task (like it is right now) and the second one being active each time this Task of 3154 actions is repeated. In some way I would like to do an inf.loop Task of this Task, with a new layout of randomisation. I hope my description is not confusing :slight_smile: Thanks.

w = Wavesets.from("my sound file");

Wavesets.prepareSynthDefs;

        w.numXings;
        w.avgLength;

//arg eventFor : startWs, numWs, repeats, playRate, useFrac

(

Task({

	3154.do({ arg i;

		var ev = w.eventFor( i,numWs:10, repeats:1, playRate:1 + 5.rand);

		ev.putPairs([\pan, [-1, 1].choose, \amp, [0.0,1].choose]);

		ev.play;

		0.001.wait;
		//(ev.sustain).wait;

	});

}).play;
)

If I understand you correctly it might be sufficient to wrap the do loop into an inf.loop, no need for a Task of Tasks.
Besides it might be worth looking into Pspawner, which allows arbitrary nesting with sequential and parallel sprouting in a dedicated (IMO by far better) syntax.

Thanks you, I am gone dive into Pspawner, that seems impressive. I feel I didn’t get your - wrap the do loop - idea, my point is to loop after the 3154.do and to relaunch the process (and so the wavefile from the begining cause it s wavesets) without any pause. What is the most simple syntax to do it ? And do you have an idea why nothing happens when I use

}).play(doReset:true);
)

Thanks

Meant this:

w = Wavesets.from(Platform.resourceDir +/+ "sounds/a11wlk01-44_1.aiff");

(
Task({
	inf.do { arg j;
		j.postln;
		w.numXings.do({ arg i;
			var ev = w.eventFor( i,numWs:10, repeats:1, playRate:1 + 5.rand);
			ev.putPairs([\pan, [-1, 1].choose, \amp, [0.0,1].choose]);
			ev.play;
			0.001.wait;
		});
	}
}).play;
)

inf.loop was maybe confusing, you could also use loop instead of inf.do.
Is this what you want ?

With “nothing happens” you probably mean that stop and start won’t cause a reset, right ?
I can confirm that from my tests, hm …

That’s it thanks Daniel.The two confusions : I didn’t think it was possible to write several layouts of iteration in a Task and I was actually expecting that doReset will make a loop of the Task, which is not its function.