-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d7e03c7
commit 305c641
Showing
25 changed files
with
26,505 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<title>Pd4Web</title> | ||
<meta charset="UTF-8" /> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.1/p5.min.js"></script> | ||
<script src="https://unpkg.com/ml5@1/dist/ml5.js"></script> | ||
<script src="./pd4web.threads.js"></script> | ||
<script src="./pd4web.js"></script> | ||
<script src="./sketch.js"></script> | ||
<style> | ||
canvas { | ||
border-radius: 30px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<span class="pd4web-sound-switch" id="Pd4WebAudioSwitch"></span> | ||
<div id="Pd4WebPatchDiv"class="Pd4WebPatchDiv"> | ||
<svg id="Pd4WebCanvas"></svg> | ||
</div> | ||
<hr> | ||
<p id="message" style="text-align: center; font-size: 20px"> | ||
Click on the page to request access to the camera and microphone. | ||
</p> | ||
<div style="display: flex; justify-content: center; border-radius: 30px"> | ||
<div id="p5js" style="border-radius: 30px"></div> | ||
</div> | ||
|
||
|
||
<script> | ||
// ╭─────────────────────────────────────╮ | ||
// │ Gui Bottoms Interface │ | ||
// ╰─────────────────────────────────────╯ | ||
var Pd4Web = null; | ||
|
||
// add window click event to start video | ||
document.addEventListener("click", async () => { | ||
navigator.mediaDevices.getUserMedia({ | ||
video: true, | ||
audio: true | ||
}); | ||
if (Pd4Web) { | ||
return; | ||
} | ||
Pd4WebModule().then((Pd4WebModulePromise) => { | ||
Pd4Web = new Pd4WebModulePromise.Pd4Web(); | ||
const message = document.getElementById("message"); | ||
if (message) { | ||
message.style.display = "none"; | ||
} | ||
}); | ||
// remove event listener | ||
document.removeEventListener("click", () => {}); | ||
}); | ||
|
||
document | ||
.getElementById("Pd4WebAudioSwitch") | ||
.addEventListener("click", async () => { | ||
startVideo(); | ||
Pd4Web.init(); | ||
console.log("Pd4Web", Pd4Web); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#N canvas 121 80 1282 686 10; | ||
#X obj 3 3 tgl 45 0 s-tgl1 r-tgl1 empty 0 -8 0 10 #fcfcfc #000000 #000000 0 1; | ||
#X obj 153 2 tgl 45 0 s-tgl2 r-tgl2 empty 0 -8 0 10 #fcfcfc #000000 #000000 0 1; | ||
#X obj 153 90 tgl 45 0 s-tgl4 r-tgl4 empty 0 -8 0 10 #fcfcfc #000000 #000000 0 1; | ||
#X obj 3 90 tgl 45 0 s-tgl3 r-tgl3 empty 0 -8 0 10 #fcfcfc #000000 #000000 0 1; | ||
#X obj 208 4 r R-8; | ||
#N canvas 266 303 622 364 tgl2 0; | ||
#X obj 2 33 unpack f f; | ||
#X obj 2 74 change; | ||
#X obj 2 119 s r-tgl2; | ||
#X obj 2 53 expr if ($f1 > 0.9 && $f2 < 0.2 \, 1 \, 0); | ||
#X obj 2 4 inlet; | ||
#X connect 0 0 3 0; | ||
#X connect 0 1 3 1; | ||
#X connect 1 0 2 0; | ||
#X connect 3 0 1 0; | ||
#X connect 4 0 0 0; | ||
#X restore 257 94 pd tgl2; | ||
#N canvas 266 303 622 364 tgl1 0; | ||
#X obj 2 4 inlet; | ||
#X obj 1 25 unpack f f; | ||
#X obj 1 45 expr if ($f1 < 0.2 && $f2 < 0.2 \, 1 \, 0); | ||
#X obj 1 111 s r-tgl1; | ||
#X obj 1 66 change; | ||
#X connect 0 0 1 0; | ||
#X connect 1 0 2 0; | ||
#X connect 1 1 2 1; | ||
#X connect 2 0 4 0; | ||
#X connect 4 0 3 0; | ||
#X restore 209 94 pd tgl1; | ||
#N canvas 266 303 622 364 tgl3 0; | ||
#X obj 2 33 unpack f f; | ||
#X obj 2 74 change; | ||
#X obj 2 4 inlet; | ||
#X obj 2 53 expr if ($f1 < 0.2 && $f2 > 0.8 \, 1 \, 0); | ||
#X obj 2 119 s r-tgl3; | ||
#X connect 0 0 3 0; | ||
#X connect 0 1 3 1; | ||
#X connect 1 0 4 0; | ||
#X connect 2 0 0 0; | ||
#X connect 3 0 1 0; | ||
#X restore 306 94 pd tgl3; | ||
#N canvas 266 303 622 364 tgl4 0; | ||
#X obj 2 33 unpack f f; | ||
#X obj 2 74 change; | ||
#X obj 2 4 inlet; | ||
#X obj 2 53 expr if ($f1 > 0.8 && $f2 > 0.8 \, 1 \, 0); | ||
#X obj 2 119 s r-tgl4; | ||
#X connect 0 0 3 0; | ||
#X connect 0 1 3 1; | ||
#X connect 1 0 4 0; | ||
#X connect 2 0 0 0; | ||
#X connect 3 0 1 0; | ||
#X restore 355 94 pd tgl4; | ||
#X text 38 57 Use your right hand!; | ||
#X connect 4 0 5 0; | ||
#X connect 4 0 6 0; | ||
#X connect 4 0 7 0; | ||
#X connect 4 0 8 0; | ||
#X coords 0 -1 1 1 200 140 1 0 0; |
Oops, something went wrong.