What is the difference between calling play on an instance of Routine or calling play on Routine directly?

What is the difference between the implementations below?

p = Routine({
    Synth(\nysynt, [\freq, 300]);
    wait(4);
}.play);
p = Routine({
    Synth(\nysynt, [\freq, 300]);
    wait(4);
});

p.play;

only the last one works, the one where I call .play on the Routine-class do not.

I get this error message:

^^ The preceding error dump is for ERROR: Primitive '_RoutineYield' failed.
Failed.                           
RECEIVER: 4                       

I am just trying to understand the difference.

Actually, in the first case you are calling play on the function inside the Routine, not on the Routine itself.
You could try

p = Routine({
    Synth(\nysynt, [\freq, 300]);
    wait(4);
}).play;

instead ( .play moved outside the bracket)

oh, that why I get the error message.

but it still does not “play”, when .play is placed to be called on the Routine:

Routine.new({}).play;

why is that?

is it because i try to call the instance method “play” as a class method?

Also be aware that Routine({…}) returns an instance of routine. (the .new method is implicit)

yes, but why does it fail silently when called:

Routine.new({...}).play;

?

it works over here…

Routine({Synth(\default);1.wait;1.postln}).play

hmm it works now, when i rewrote the routine like yours, but i cannot find where the difference is in my original code:

Routine({
    var fund = 300;
    Synth(\synt, [\freq, fund]);
    wait(5);
    Synth(\synt, [\freq, fund * (3/2)]);
    wait(5);
    Synth(\synt, [\freq, fund * (5/9)]);
    wait(7.5);
    Synth(\synt, [\freq, fund * (5/4)]);
    wait(2.5);
}).play;

it still won’t run, it only returns

-> a Routine

EDIT:
I had forgot to wrap the Routine inside parenthesis. it works now.