TempoClock doesn't work in a Dictionary?

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

TempoClock doesn't work in a Dictionary?

by Juan Gabriel Alzate Romero :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear list,

I'm a little bit troubled why this code won't work (it works, but not as desired)

(
q = ();
q.clock = TempoClock(5);

Pbindef(\a, \dur, 1);
Pbindef(\b, \dur, 0.5);
Pbindef(\c, \dur, 0.25);
Pbindef(\d, \dur, 0.125);

Ptpar([
0, Pdef(\a),
10, Pdef(\b),
15, Pdef(\c),
30, Pdef(\d),
]).play(clock: q.clock);
)



---but this one does---


(
t = TempoClock(5);

Pbindef(\a, \dur, 1);
Pbindef(\b, \dur, 0.5);
Pbindef(\c, \dur, 0.25);
Pbindef(\d, \dur, 0.125);

Ptpar([
0, Pdef(\a),
10, Pdef(\b),
15, Pdef(\c),
30, Pdef(\d),
]).play(clock: t);
)


Now, does this problem has to do woth Ptpar? or with using the TempoClock on a dictionary?

Thanks.

-Juan

Re: TempoClock doesn't work in a Dictionary?

by Batuhan Bozkurt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Juan,

Can't see what you are trying to achieve here, and I'm not very experienced with patterns, but this might keep you going:

First of all, q in your non working example is not a dictionary but an Event.

q = ();
q.class;

When you assign a key called event, it is not added to the event, probably because it is interpreted as something else (not really sure about the mechanics behind it):

q =  ();
q.clock = TempoClock(5);
q.clock; //nil

Instead use a different name for your clock:

q = ();
q.whatever = TempoClock(5);
q.whatever; //a tempo clock

And use that:
.....]).play(clock: q.whatever);

Hope that helps...

B.B.

On Apr 18, 2009, at 12:24 PM, Juan Gabriel Alzate Romero wrote:

Dear list,

I'm a little bit troubled why this code won't work (it works, but not as desired)

(
q = ();
q.clock = TempoClock(5);

Pbindef(\a, \dur, 1);
Pbindef(\b, \dur, 0.5);
Pbindef(\c, \dur, 0.25);
Pbindef(\d, \dur, 0.125);

Ptpar([
0, Pdef(\a),
10, Pdef(\b),
15, Pdef(\c),
30, Pdef(\d),
]).play(clock: q.clock);
)



---but this one does---


(
t = TempoClock(5);

Pbindef(\a, \dur, 1);
Pbindef(\b, \dur, 0.5);
Pbindef(\c, \dur, 0.25);
Pbindef(\d, \dur, 0.125);

Ptpar([
0, Pdef(\a),
10, Pdef(\b),
15, Pdef(\c),
30, Pdef(\d),
]).play(clock: t);
)


Now, does this problem has to do woth Ptpar? or with using the TempoClock on a dictionary?

Thanks.

-Juan


Re: TempoClock doesn't work in a Dictionary?

by Juan Gabriel Alzate Romero :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, and thanks for your answer.

Hi Juan,

Can't see what you are trying to achieve here, and I'm not very experienced with patterns, but this might keep you going:

Justwanted to start different Ptpars in different tempi, bus as the 1th Ptpar didn't worked I had to ask the list.

First of all, q in your non working example is not a dictionary but an Event.

q = ();
q.class;

I see.  I always used the "( )" as an IdentityDictionary but I wasn't aware of the mechanics in the background.

When you assign a key called event, it is not added to the event, probably because it is interpreted as something else (not really sure about the mechanics behind it):

q =  ();
q.clock = TempoClock(5);
q.clock; //nil

Instead use a different name for your clock:

q = ();
q.whatever = TempoClock(5);
q.whatever; //a tempo clock

And use that:
.....]).play(clock: q.whatever);


That works... hm... funny the name "clock" won't work.  I guess I'll just name it "myClock" ;-)  Anyway I need different Clocks, so I'll just give them a different name than "clock"

Hope that helps...


Totally :-)  Just still wondering why the name "clock" wont work.  But anyway, I can do now what I wanted.

Thanks.

Juan.


B.B.

On Apr 18, 2009, at 12:24 PM, Juan Gabriel Alzate Romero wrote:

Dear list,

I'm a little bit troubled why this code won't work (it works, but not as desired)

(
q = ();
q.clock = TempoClock(5);

Pbindef(\a, \dur, 1);
Pbindef(\b, \dur, 0.5);
Pbindef(\c, \dur, 0.25);
Pbindef(\d, \dur, 0.125);

Ptpar([
0, Pdef(\a),
10, Pdef(\b),
15, Pdef(\c),
30, Pdef(\d),
]).play(clock: q.clock);
)



---but this one does---


(
t = TempoClock(5);

Pbindef(\a, \dur, 1);
Pbindef(\b, \dur, 0.5);
Pbindef(\c, \dur, 0.25);
Pbindef(\d, \dur, 0.125);

Ptpar([
0, Pdef(\a),
10, Pdef(\b),
15, Pdef(\c),
30, Pdef(\d),
]).play(clock: t);
)


Now, does this problem has to do woth Ptpar? or with using the TempoClock on a dictionary?

Thanks.

-Juan



Re: TempoClock doesn't work in a Dictionary?

by Julian Rohrhuber :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>
>That works... hm... funny the name "clock" won't work.  I guess I'll
>just name it "myClock" ;-)  Anyway I need different Clocks, so I'll
>just give them a different name than "clock"

the test whether a method is unused  in an event is usually:

a = ();
a.clock = \something;

if this throws no error, then it should work actually.
--





.

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Re: TempoClock doesn't work in a Dictionary?

by James Harkins-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The warning doesn't appear here because of Object:clock_, which gobbles up the call before Event gets its hands on it.
hjh

On Apr 18, 2009, at 4:32 PM, Julian Rohrhuber wrote:


That works... hm... funny the name "clock" won't work.  I guess I'll just name it "myClock" ;-)  Anyway I need different Clocks, so I'll just give them a different name than "clock"

the test whether a method is unused  in an event is usually:

a = ();
a.clock = \something;

if this throws no error, then it should work actually.



: H. James Harkins
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:

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