Skip to content

server related tests? #7

@telephon

Description

@telephon

Not sure how we should handle server related tests.

Here are doneAction tests, not yet in the form required. But where to put them?


(
SynthDef(\test_env_done_actions, { |doneAction, gate = 1|
    EnvGen.kr(Env.asr(0, 1, 0), gate,doneAction:doneAction)
}).add
)

// doneAction 0: do nothing when the UGen is finished

g = Group(s).register;
h = Synth(\test_env_done_actions, [\doneAction, 1], g, \addToHead).register;
h.set(\gate, 0);
g.isPlaying and: { h.isPlaying }




// doneAction 1: pause the enclosing synth, but do not free it

g = Group(s).register;
h = Synth(\test_env_done_actions, [\doneAction, 1], g, \addToHead).register;
h.set(\gate, 0);
g.isPlaying and: { h.isPlaying } and: { h.isRunning.not }



// doneAction 2: free the enclosing synth

g = Group(s).register;
h = Synth(\test_env_done_actions, [\doneAction, 2], g, \addToHead).register;
h.set(\gate, 0);
g.isPlaying and: { h.isPlaying.not }



// doneAction 3: free both this synth and the preceding node

g = Group(s).register;
h = Synth(\test_env_done_actions, [\doneAction, 3], g, \addAfter).register;
h.set(\gate, 0);
g.isPlaying.not and: { h.isPlaying.not }



// doneAction 4: free both this synth and the following node

g = Group(s).register;
h = Synth(\test_env_done_actions, [\doneAction, 4], g, \addBefore).register;
h.set(\gate, 0);
g.isPlaying.not and: { h.isPlaying.not }


// doneAction 5: free this synth; if the preceding node is a group then do g_freeAll on it, else free it

g = Group(s).register;
h = Synth(\test_env_done_actions, [\doneAction, 5], g, \addAfter).register;
z = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToHead).register;
h.set(\gate, 0);
g.isPlaying and: { h.isPlaying.not } and: { z.isPlaying.not }


// doneAction 6: free this synth; if the following node is a group then do g_freeAll on it, else free it

g = Group(s).register;
h = Synth(\test_env_done_actions, [\doneAction, 6], g, \addBefore).register;
z = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToHead).register;
h.set(\gate, 0);
g.isPlaying and: { h.isPlaying.not } and: { z.isPlaying.not }

// doneAction 7: free this synth and all preceding nodes in this group

g = Group(s).register;
h = Synth(\test_env_done_actions, [\doneAction, 7], g, \addToHead).register;
x = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToHead).register;
y = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToTail).register;
h.set(\gate, 0);
g.isPlaying and: { h.isPlaying.not } and: { y.isPlaying } and: { x.isPlaying.not }


// doneAction 8: free this synth and all following nodes in this group

g = Group(s).register;
h = Synth(\test_env_done_actions, [\doneAction, 8], g, \addToHead).register;
x = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToHead).register;
y = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToTail).register;
h.set(\gate, 0);
g.isPlaying and: { h.isPlaying.not } and: { x.isPlaying } and: { y.isPlaying.not }


// doneAction 9: free this synth and pause the preceding node

g = Group(s).register;
x = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToTail).register;
y = Synth(\test_env_done_actions, [\doneAction, 9], g, \addToTail).register;
y.set(\gate, 0);
y.isPlaying.not and: { x.isRunning.not }



// doneAction 10: free this synth and pause the following node

g = Group(s).register;
x = Synth(\test_env_done_actions, [\doneAction, 10], g, \addToTail).register;
y = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToTail).register;
x.set(\gate, 0);
x.isPlaying.not and: { y.isRunning.not }

// doneAction 11: free this synth and if the preceding node is a group then do g_deepFree on it, else free it

g = Group(s).register;
h = Synth(\test_env_done_actions, [\doneAction, 11], g, \addAfter).register;
z = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToHead).register;
h.set(\gate, 0);
g.isPlaying and: { h.isPlaying.not } and: { z.isPlaying.not }


// doneAction 12: free this synth and if the following node is a group then do g_deepFree on it, else free it

g = Group(s).register;
h = Synth(\test_env_done_actions, [\doneAction, 12], g, \addBefore).register;
z = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToHead).register;
h.set(\gate, 0);
g.isPlaying and: { h.isPlaying.not } and: { z.isPlaying.not }


// doneAction 13: free this synth and all other nodes in this group (before and after)

g = Group(s).register;
x = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToHead).register;
h = Synth(\test_env_done_actions, [\doneAction, 13], g, \addToHead).register;
y = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToHead).register;
h.set(\gate, 0);
g.isPlaying and: { h.isPlaying.not } and: { y.isPlaying.not } and: { x.isPlaying.not }


// doneAction 14: free the enclosing group and all nodes within it (including this synth)


g = Group(s).register;
x = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToHead).register;
h = Synth(\test_env_done_actions, [\doneAction, 14], g, \addToHead).register;
y = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToHead).register;
h.set(\gate, 0);
g.isPlaying.not and: { h.isPlaying.not } and: { y.isPlaying.not } and: { x.isPlaying.not }

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions