Task SystemClock Cmd-period

View: New views
9 Messages — Rating Filter:   Alert me  

Task SystemClock Cmd-period

by Stephan Wittwer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Either this is a bug or the documentation should dissuade from using  
the SystemClock as arg to Meta_Task:new

The problem:
Unfortunately Cmd-. doesn't make set the task's variables 'stream' and  
'nextBeat' to nil.

This leads to the contradictory situation that both 'isPlaying' and  
'wasStopped' are true at the same time !

Thanks
Stephan

_______________________________________________
sc-users mailing list

info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Re: Task SystemClock Cmd-period

by James Harkins-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Jul 10, 2008, at 1:20 PM, Stephan Wittwer wrote:

Either this is a bug or the documentation should dissuade from using the SystemClock as arg to Meta_Task:new

The problem:
Unfortunately Cmd-. doesn't make set the task's variables 'stream' and 'nextBeat' to nil.

Looks like a bug to me... the problem is that TempoClock does this:

clear { | releaseNodes = true |
// flag tells EventStreamPlayers that CmdPeriod is removing them, so
// nodes are already freed
queue.pairsDo { arg time, item; item.removedFromScheduler(releaseNodes) };
^this.prClear;
}

... while SystemClock does not.

Shouldn't be hard to fix, and I think it's worth doing to avoid confusion.

(At the same time, I'm having trouble thinking of a good reason why someone would use SystemClock rather than TempoClock. We have to keep it in the library for backward compatibility, but I can't think of anything you could do with SystemClock that you can't do just as well with TempoClock.)

hjh



: H. James Harkins

: jamshark70@...

: http://www.dewdrop-world.net

.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:


"Come said the Muse,

Sing me a song no poet has yet chanted,

Sing me the universal."  -- Whitman



Re: Task SystemClock Cmd-period

by Julian Rohrhuber :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>
>... while SystemClock does not.
>
>Shouldn't be hard to fix, and I think it's worth doing to avoid confusion.


yes, the only problem is that the SytemClock's queue is hidden.


>(At the same time, I'm having trouble thinking of a good reason why
>someone would use SystemClock rather than TempoClock. We have to
>keep it in the library for backward compatibility, but I can't think
>of anything you could do with SystemClock that you can't do just as
>well with TempoClock.)

Maybe we could change SystemClock to a TempoClock singleton with
fixed tempo? I don't know about efficiency though.
--





.

_______________________________________________
sc-users mailing list

info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Re: Task SystemClock Cmd-period

by James Harkins-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Jul 11, 2008, at 8:00 AM, Julian Rohrhuber wrote:


... while SystemClock does not.

Shouldn't be hard to fix, and I think it's worth doing to avoid confusion.

yes, the only problem is that the SytemClock's queue is hidden.

Oh, I guess it is hard to fix then *oops*
hjh


: H. James Harkins

: jamshark70@...

: http://www.dewdrop-world.net

.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:


"Come said the Muse,

Sing me a song no poet has yet chanted,

Sing me the universal."  -- Whitman



Re: Task SystemClock Cmd-period

by James Harkins-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Jul 11, 2008, at 8:00 AM, Julian Rohrhuber wrote:

(At the same time, I'm having trouble thinking of a good reason why someone would use SystemClock rather than TempoClock. We have to keep it in the library for backward compatibility, but I can't think of anything you could do with SystemClock that you can't do just as well with TempoClock.)

Maybe we could change SystemClock to a TempoClock singleton with fixed tempo? I don't know about efficiency though.

One difference is (IIRC) that SystemClock measures the number of seconds elapsed since the application was launched, while TempoClocks reset to zero when the library is recompiled.

I don't know if that's important to anybody. I don't recall ever using that distinction for anything meaningful.
hjh


: H. James Harkins

: jamshark70@...

: http://www.dewdrop-world.net

.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:


"Come said the Muse,

Sing me a song no poet has yet chanted,

Sing me the universal."  -- Whitman



Re: Task SystemClock Cmd-period

by Stephan Wittwer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Am 11.07.2008 um 13:55 schrieb James Harkins:

> Shouldn't be hard to fix, and I think it's worth doing to avoid  
> confusion.

Would appreciate it.

>
> (At the same time, I'm having trouble thinking of a good reason why  
> someone would use SystemClock rather than TempoClock.

I look at it the other way around:

Why make a new instance of TempoClock in a situation where the  
SystemClock, which is always existing, would suffice?

(E.G. forking threads with delta times, not thinking in (musical)  
beats. See Routine:play)



_______________________________________________
sc-users mailing list

info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Re: Task SystemClock Cmd-period

by Eric Lyon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

No idea if this is relevant, but I have a patch that works perfectly when I use SystemClock but crashes when I swap in TempoClock, with the following error:

ERROR: Message 'secs2beats' not understood.
RECEIVER:
class TempoClock (181E46D0) {
  instance variables [19]
    name : Symbol 'TempoClock'
    nextclass : class TempoGui (18301C20)
    superclass : Symbol 'Clock'
    subclasses : instance of Array (180FB7C0, size=1, set=1)
    methods : instance of Array (181E4790, size=40, set=6)
    instVarNames : instance of SymbolArray (181E49C0, size=7, set=2)
    classVarNames : instance of SymbolArray (181E4A80, size=2, set=1)
    iprototype : instance of Array (181E4A10, size=7, set=3)
    cprototype : instance of Array (181E4AC0, size=2, set=1)
    constNames : nil
    constValues : nil
    instanceFormat : Integer 0
    instanceFlags : Integer 0
    classIndex : Integer 585
    classFlags : Integer 0
    maxSubclassIndex : Integer 586
    filenameSymbol : Symbol '/Applications/SuperCollider/SCClassLibrary/Common/Core/Clock.sc'
    charPos : Integer 823
    classVarIndex : Integer 63
}
ARGS:
   Float 0.001   3F50624D D2F1A9FC
CALL STACK:
    DoesNotUnderstandError:reportError   180506F0
        arg this = <instance of DoesNotUnderstandError>
    Nil:handleError   18088330
        arg this = nil
        arg error = <instance of DoesNotUnderstandError>
    Thread:handleError   18064530
        arg this = <instance of Thread>
        arg error = <instance of DoesNotUnderstandError>
    Thread:handleError   180A7BD0
        arg this = <instance of Routine>
        arg error = <instance of DoesNotUnderstandError>
    Object:throw   180D2510
        arg this = <instance of DoesNotUnderstandError>
    Object:doesNotUnderstand   1809BD70
        arg this = class TempoClock
        arg selector = 'secs2beats'
        arg args = [*1]
    Scheduler:seconds_   17433840
        arg this = <instance of Scheduler>
        arg newSeconds = 0.001
        var delta = <instance of Synth>
        var item = <instance of Function>
    Scheduler:advance   1807D130
        arg this = <instance of Scheduler>
        arg delta = 0.001
    < FunctionDef in closed FunctionDef >   180DFCB0
        var delta = 0.001
    Routine:prStart   180743D0
        arg this = <instance of Routine>
        arg inval = 50021.098577007004


I found it simpler to just use SystemClock everywhere than try to figure out what was going wrong with TempoClock, but I'd be happy to post the code that caused this if anyone is interested.

Eric


On Fri, Jul 11, 2008 at 8:54 AM, Stephan Wittwer <s@...> wrote:

Am 11.07.2008 um 13:55 schrieb James Harkins:


Shouldn't be hard to fix, and I think it's worth doing to avoid confusion.

Would appreciate it.



(At the same time, I'm having trouble thinking of a good reason why someone would use SystemClock rather than TempoClock.

I look at it the other way around:

Why make a new instance of TempoClock in a situation where the SystemClock, which is always existing, would suffice?

(E.G. forking threads with delta times, not thinking in (musical) beats. See Routine:play)




_______________________________________________
sc-users mailing list

info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/


Re: Task SystemClock Cmd-period

by James Harkins-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That's because you have to use TempoClock.default.

There is only one systemclock but could be many tempoclocks... so when
you use tempoclock, you have to say which one.
hjh

On Fri, Jul 11, 2008 at 12:25 PM, Eric Lyon <audiodidact@...> wrote:
> No idea if this is relevant, but I have a patch that works perfectly when I
> use SystemClock but crashes when I swap in TempoClock, with the following
> error:
>
> ERROR: Message 'secs2beats' not understood.
> RECEIVER:
> class TempoClock (181E46D0) {


--
James Harkins /// dewdrop world
jamshark70@...
http://www.dewdrop-world.net

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal." -- Whitman

_______________________________________________
sc-users mailing list

info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Re: Task SystemClock Cmd-period

by Eric Lyon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Fri, Jul 11, 2008 at 1:32 PM, James Harkins <jamshark70@...> wrote:
That's because you have to use TempoClock.default.

There is only one systemclock but could be many tempoclocks... so when
you use tempoclock, you have to say which one.
hjh

Thanks for that. The phrase "baroque vortex" comes to mind :)

Eric
 


On Fri, Jul 11, 2008 at 12:25 PM, Eric Lyon <audiodidact@...> wrote:
> No idea if this is relevant, but I have a patch that works perfectly when I
> use SystemClock but crashes when I swap in TempoClock, with the following
> error:
>
> ERROR: Message 'secs2beats' not understood.
> RECEIVER:
> class TempoClock (181E46D0) {


--
James Harkins /// dewdrop world
jamshark70@...
http://www.dewdrop-world.net

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal." -- Whitman

_______________________________________________
sc-users mailing list

info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

LightInTheBox - Buy quality products at wholesale price