-
-
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.
Merge branch 'main' of https://github.com/charlesneimog/pd4web
- Loading branch information
Showing
103 changed files
with
72,854 additions
and
101 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
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,23 @@ | ||
--- | ||
hide: | ||
- toc | ||
--- | ||
|
||
# <h1 align="center">Template <code>4</code>: p5js and pd4web</h1> | ||
|
||
!!! tip "Template designed for those who know how to program" | ||
Learn how to program, I really recommend watch the [Coding Train](https://www.youtube.com/user/shiffman) channel. It is a great channel to learn how to program in a fun way. | ||
|
||
This template is for the combination of `p5js` and `pd4web`. It is a simple template that uses the `p5js` library to create a canvas and pd4web to create a patch that can be used to control the canvas (or vice-versa). | ||
|
||
<p align="center"> | ||
<img src="../assets/p5js.png" width="80%" style="cursor: pointer; border-radius: 10px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);" onclick="window.open('./../templates/p5js', '_blank');" > | ||
</p> | ||
|
||
<p align="center" markdown> | ||
:octicons-download-16: [Download Patch Template](../patches/template-4.zip) | ||
</p> | ||
|
||
There is no much to say about this template, it just use a personalized `index.html` and `sketch.js`, where you can code you `p5js` code. | ||
|
||
Just download and have fun. If you have any question, please, let me know. If you have some questions about `p5js` or `pd4web` you can ask me too. I will be glad to help you. |
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,28 @@ | ||
--- | ||
hide: | ||
- toc | ||
--- | ||
|
||
# <h1 align="center">Template <code>5</code>: Tutorial Patches</h1> | ||
|
||
Patch side by side with some text to explain the patch. The result will be something like this: | ||
|
||
<p align="center"> | ||
<img src="../assets/tutorial.png" width="80%" style="cursor: pointer; border-radius: 10px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);" onclick="window.open('./../templates/tutorial', '_blank');"> | ||
</p> | ||
|
||
To make the description again we use a markdown file. The markdown is called `tutorial.md` and is located in the `WebPatch` folder. The content of the file should be edited after compilation of the patch. | ||
|
||
As in the previous template, inside `tutorial.md` you can write some description about the patch. The file uses markdown to render, you can check the complet syntax in https://www.markdownguide.org/basic-syntax/. Below the example of main command: | ||
|
||
``` md | ||
# Title 1 | ||
## Title 2 | ||
### Title 3 | ||
|
||
**bold text** | ||
*italic text** | ||
|
||
* this one item | ||
* this is another item | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 was deleted.
Oops, something went wrong.
Binary file not shown.
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; |
File renamed without changes.
Oops, something went wrong.