[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] Weird behavior of Clock
mmm, I see, thank you Nick.
> On 17 Dec 2015, at 12:50, Nick Collins <clicksonnil@xxxxxxxxx> wrote:
>
> 2.do when evaluated returns 2
>
> The last thing in the function to be scheduled is the time gap till the next time the function is called again
>
> Hence your 2 second rescheduling problem.
>
> To delay, you could try:
> { 2.wait; "now do this".postln }.fork
>
> Add the defer around the postln part if you had, say, GUI control code.
>
> best
> N
>
> On 17 Dec 2015, at 10:32, Orestis Karamanlis <o.karamanlis@xxxxxxxxx> wrote:
>
>> If anyone can enlighten me on this one it would be very helpful.
>>
>> // The following works without a problem
>> { 2.do{arg i; i.postln} }.defer(1);
>>
>> // However this, keeps evaluating the function every 2 seconds (equivalent to do's iteration number)
>> SystemClock.sched(1, { 2.do{arg i; i.postln } } );
>>
>> The same happens with for, forby, etc. What am I missing here?
>>
>> In short, I am trying to schedule something in the future making also some use of control structures which seems impossible without using defer.
>> _______________________________________________
>> sc-users mailing list
>>
>> info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
>> 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.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
> 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.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/