Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch from Tdef to Task for beacon #500

Merged
merged 1 commit into from
Jul 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 13 additions & 15 deletions caster-sound/GenCaster/classes/GenCaster.sc
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ GenCasterServer {
var <>oscBackendClient;
var <>environment; // shall this be a proxy space?
var <>server;
var <beacon;

// basically a constructor which allows us to set
// the necessary values directly or via env variables
Expand Down Expand Up @@ -319,6 +320,17 @@ GenCasterServer {
environment[\oscBackendClient] = oscBackendClient;
environment[\this] = this;
this.loadSynthDefs;
beacon = Task({
inf.do({
this.sendAck(
status: GenCasterStatus.beacon,
uuid: 0,
message: this.serverInfo,
address: "/beacon",
);
5.wait;
});
});
}

loadSynthDefs {
Expand Down Expand Up @@ -426,20 +438,6 @@ GenCasterServer {
server.waitForBoot(onComplete: this.postStartServer);
}

beacon { |waitTime=5.0|
^Tdef(\beacon, {
inf.do({
this.sendAck(
status: GenCasterStatus.beacon,
uuid: 0,
message: this.serverInfo,
address: "/beacon",
);
waitTime.wait;
});
});
}

instructionReceiver {
^OSCdef(\instructionReceiver, {|msg, time, addr, recvPort|
var uuid = msg[1];
Expand Down Expand Up @@ -471,7 +469,7 @@ GenCasterServer {
postStartServer {
"Finished booting server".postln;
"Start beacon".postln;
this.beacon.play;
beacon.play;
this.instructionReceiver;
}
}
Loading