pd4web 2.2.7__tar.gz → 2.3.0.dev1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/PKG-INFO +3 -3
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/Libraries.yaml +28 -2
- pd4web-2.3.0.dev1/Sources/Libraries/earplug~.cmake +7 -0
- pd4web-2.3.0.dev1/Sources/Libraries/extra.cmake +21 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/o.scofo~.cmake +2 -1
- pd4web-2.3.0.dev1/Sources/Libraries/partialtrack~.cmake +6 -0
- pd4web-2.3.0.dev1/Sources/Libraries/soundtouch~.cmake +5 -0
- pd4web-2.3.0.dev1/Sources/Templates/1/index.html +151 -0
- pd4web-2.3.0.dev1/Sources/Templates/2/index.html +64 -0
- pd4web-2.3.0.dev1/Sources/Templates/3/index.html +472 -0
- pd4web-2.3.0.dev1/Sources/Templates/4/index.html +36 -0
- pd4web-2.3.0.dev1/Sources/Templates/5/index.html +165 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/__init__.py +1 -1
- pd4web-2.3.0.dev1/Sources/index.html +46 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/pd4web/Builder.py +21 -9
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/pd4web/Compilers.py +31 -56
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/pd4web/Libraries.py +25 -8
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/pd4web/Objects.py +10 -2
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/pd4web/Patch.py +48 -10
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/pd4web/Pd4Web.py +118 -65
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/pd4web.cpp +25 -6
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/pd4web.gui.js +375 -54
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/pyproject.toml +1 -1
- pd4web-2.2.7/Sources/Libraries/earplug.cmake +0 -6
- pd4web-2.2.7/Sources/Templates/1/index.html +0 -158
- pd4web-2.2.7/Sources/Templates/2/index.html +0 -66
- pd4web-2.2.7/Sources/Templates/3/index.html +0 -505
- pd4web-2.2.7/Sources/Templates/4/index.html +0 -36
- pd4web-2.2.7/Sources/Templates/5/index.html +0 -149
- pd4web-2.2.7/Sources/index.html +0 -30
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/LICENSE +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/README.md +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/.clang-format +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/.prettierrc +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/.yamlftm +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/ambi~.cmake +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/cyclone.cmake +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/else.cmake +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/libpd.cmake +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/pd.cmake/.git +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/pd.cmake/.github/workflows/c-cpp.yml +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/pd.cmake/.gitignore +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/pd.cmake/CMakeLists.txt +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/pd.cmake/Examples/.clang-format +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/pd.cmake/Examples/CMakeLists.txt +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/pd.cmake/Examples/fft~/fft~-help.pd +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/pd.cmake/Examples/fft~/fft~.cpp +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/pd.cmake/Examples/simple/simple-help.pd +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/pd.cmake/Examples/simple/simple-patch.pd +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/pd.cmake/Examples/simple/simple.cpp +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/pd.cmake/Examples/simple~/simple~-help.pd +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/pd.cmake/Examples/simple~/simple~.cpp +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/pd.cmake/LICENSE +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/pd.cmake/README.md +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/pd.cmake/Tests/01.Deprecated-Functions/CMakeLists.txt +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/pd.cmake/Tests/CMakeLists.txt +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/pd.cmake/pd.cmake +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/pmpd.cmake +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Libraries/timbreIDLib.cmake +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Templates/1/bula.md +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Templates/2/sketch.js +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Templates/4/sketch.js +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/Templates/5/tutorial.md +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/cmake-format.yaml +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/config.h +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/externals.cpp +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/favicon.ico +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/nogui.html +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/pd4web/__init__.py +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/pd4web.gitignore +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/pd4web.hpp +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/pd4web.midi.js +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/pd4web.style.css +0 -0
- {pd4web-2.2.7 → pd4web-2.3.0.dev1}/Sources/pd4web.threads.js +0 -0
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: pd4web
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.0.dev1
|
|
4
4
|
Summary: pd4web compiles PureData patches with external objects for Wasm, allowing to run entire patches in web browsers.
|
|
5
|
-
Home-page: https://charlesneimog.github.io/pd4web
|
|
6
5
|
Author: Charles K. Neimog
|
|
7
6
|
Author-email: charlesneimog@outlook.com
|
|
8
7
|
Requires-Python: >=3.9,<4.0
|
|
@@ -18,6 +17,7 @@ Requires-Dist: pygit2 (>=1.15.1,<2.0.0)
|
|
|
18
17
|
Requires-Dist: pyyaml (>=6.0.0,<7.0.0)
|
|
19
18
|
Requires-Dist: requests (>=2.31.0,<3.0.0)
|
|
20
19
|
Project-URL: Documentation, https://www.charlesneimog.github.io/pd4web
|
|
20
|
+
Project-URL: Homepage, https://charlesneimog.github.io/pd4web
|
|
21
21
|
Project-URL: Repository, https://github.com/charlesneimog/pd4web
|
|
22
22
|
Description-Content-Type: text/markdown
|
|
23
23
|
|
|
@@ -9,6 +9,32 @@ Sources:
|
|
|
9
9
|
#│ Libraries │
|
|
10
10
|
#╰──────────────────────────────────────╯
|
|
11
11
|
Libraries:
|
|
12
|
+
# ─────────────── soundtouch~ ───────────────
|
|
13
|
+
- Name: soundtouch~
|
|
14
|
+
Source: GITHUB
|
|
15
|
+
Developer: charlesneimog
|
|
16
|
+
Repository: pd-soundtouch
|
|
17
|
+
Version: 35bee0ca34bd4e24c0df28831aed56442968ad35
|
|
18
|
+
# ─────────────── earplug~ ───────────────
|
|
19
|
+
- Name: earplug~
|
|
20
|
+
Source: GITHUB
|
|
21
|
+
Developer: pd-externals
|
|
22
|
+
Repository: earplug
|
|
23
|
+
Version: d7c9bb8528c7fc583fb0d2e9181aa510af87f165
|
|
24
|
+
# ───────────── pdlua ─────────────
|
|
25
|
+
- Name: pdlua
|
|
26
|
+
Source: GITHUB
|
|
27
|
+
Developer: agraef
|
|
28
|
+
Repository: pd-lua
|
|
29
|
+
Version: 4301f744a9023ea77b6fe0ba35918ad18e19276f
|
|
30
|
+
|
|
31
|
+
# ───────────── partialtrack ─────────────
|
|
32
|
+
- Name: partialtrack~
|
|
33
|
+
Source: GITHUB
|
|
34
|
+
Developer: charlesneimog
|
|
35
|
+
Repository: pd-partialtrack
|
|
36
|
+
Version: 5b7abde223adc94db7f70ba122a4c613f20b7509
|
|
37
|
+
|
|
12
38
|
# ───────────────── pmpd ─────────────────
|
|
13
39
|
- Name: pmpd
|
|
14
40
|
Source: GITHUB
|
|
@@ -72,7 +98,7 @@ Libraries:
|
|
|
72
98
|
- sfz~
|
|
73
99
|
- sfont~
|
|
74
100
|
- play.file~
|
|
75
|
-
- sfload
|
|
101
|
+
- sfload
|
|
76
102
|
|
|
77
103
|
# Osc is not support on browsers
|
|
78
104
|
|
|
@@ -109,4 +135,4 @@ Libraries:
|
|
|
109
135
|
|
|
110
136
|
# need extra objects
|
|
111
137
|
- pvoc.freeze~
|
|
112
|
-
- freeze~
|
|
138
|
+
# - freeze~
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.25)
|
|
2
|
+
project(extra)
|
|
3
|
+
set(LIB_DIR ${PD4WEB_EXTERNAL_DIR}/../pure-data/extra)
|
|
4
|
+
|
|
5
|
+
add_definitions(-DPD)
|
|
6
|
+
|
|
7
|
+
set(BOB_FILE "${LIB_DIR}/bob~/bob~.c")
|
|
8
|
+
set(BONK_FILE "${LIB_DIR}/bonk~/bonk~.c")
|
|
9
|
+
set(SIGMUND_FILE "${LIB_DIR}/sigmund~/sigmund~.c")
|
|
10
|
+
|
|
11
|
+
if(EXISTS "${BOB_FILE}")
|
|
12
|
+
pd_add_external(bob~ "${BOB_FILE}")
|
|
13
|
+
endif()
|
|
14
|
+
|
|
15
|
+
if(EXISTS "${BONK_FILE}")
|
|
16
|
+
pd_add_external(bonk~ "${BONK_FILE}")
|
|
17
|
+
endif()
|
|
18
|
+
|
|
19
|
+
if(EXISTS "${SIGMUND_FILE}")
|
|
20
|
+
pd_add_external(sigmund~ "${SIGMUND_FILE}")
|
|
21
|
+
endif()
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<title>Pd4Web</title>
|
|
5
|
+
<script data-goatcounter="https://pd4web.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>
|
|
6
|
+
<meta charset="UTF-8" />
|
|
7
|
+
<!-- pd4web.threads.js can help if you can't active Cross-Origin Resource Sharing (CORS) from server side -->
|
|
8
|
+
<script src="./pd4web.threads.js"></script>
|
|
9
|
+
<script src="./pd4web.js"></script>
|
|
10
|
+
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
|
11
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css" />
|
|
12
|
+
<style>
|
|
13
|
+
/* Style for the entire Markdown content container */
|
|
14
|
+
#Pd4WebText {
|
|
15
|
+
font-family: Arial, sans-serif;
|
|
16
|
+
line-height: 1.6;
|
|
17
|
+
padding: 20px;
|
|
18
|
+
border-radius: 8px;
|
|
19
|
+
text-align: center;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* Style for h1 tags inside #Pd4WebText */
|
|
23
|
+
#Pd4WebText h1 {
|
|
24
|
+
font-size: 2em;
|
|
25
|
+
color: #2c3e50;
|
|
26
|
+
margin-bottom: 0.5em;
|
|
27
|
+
padding-bottom: 0.3em;
|
|
28
|
+
text-align: center;
|
|
29
|
+
user-select: none;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Style for h2 tags inside #Pd4WebText */
|
|
33
|
+
#Pd4WebText h2 {
|
|
34
|
+
font-size: 1.75em;
|
|
35
|
+
color: #34495e;
|
|
36
|
+
margin-top: 1em;
|
|
37
|
+
margin-bottom: 0.5em;
|
|
38
|
+
text-align: center;
|
|
39
|
+
user-select: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Style for paragraph tags inside #Pd4WebText */
|
|
43
|
+
#Pd4WebText p {
|
|
44
|
+
font-size: 1.5em;
|
|
45
|
+
color: #000000;
|
|
46
|
+
margin-bottom: 1em;
|
|
47
|
+
text-align: justify;
|
|
48
|
+
user-select: none;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Style for lists */
|
|
52
|
+
#Pd4WebText ul {
|
|
53
|
+
list-style-type: disc;
|
|
54
|
+
margin-left: 20px;
|
|
55
|
+
margin-bottom: 1em;
|
|
56
|
+
text-align: left;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
#Pd4WebText ol {
|
|
60
|
+
list-style-type: decimal;
|
|
61
|
+
margin-left: 1px;
|
|
62
|
+
margin-bottom: 1em;
|
|
63
|
+
font-size: 1.5em;
|
|
64
|
+
text-align: left;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
#Pd4WebText ul {
|
|
68
|
+
list-style-type: disc; /* Use a disc (default bullet) */
|
|
69
|
+
margin-left: 2px;
|
|
70
|
+
padding-left: 0px;
|
|
71
|
+
font-size: 1.2em;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* Style for each list item */
|
|
75
|
+
#Pd4WebText li {
|
|
76
|
+
font-size: 1.2em;
|
|
77
|
+
color: #000000; /* Dark gray color */
|
|
78
|
+
margin-bottom: 0.5em; /* Space between items */
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.pd4web-fullscreen {
|
|
82
|
+
content: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzIiIHdpZHRoPSIyOCIgdmlld0JveD0iMCAwIDQ0OCA1MTIiPjwhLS0hRm9udCBBd2Vzb21lIEZyZWUgNi42LjAgYnkgQGZvbnRhd2Vzb21lIC0gaHR0cHM6Ly9mb250YXdlc29tZS5jb20gTGljZW5zZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tL2xpY2Vuc2UvZnJlZSBDb3B5cmlnaHQgMjAyNCBGb250aWNvbnMsIEluYy4tLT48cGF0aCBkPSJNMzIgMzJDMTQuMyAzMiAwIDQ2LjMgMCA2NGwwIDk2YzAgMTcuNyAxNC4zIDMyIDMyIDMyczMyLTE0LjMgMzItMzJsMC02NCA2NCAwYzE3LjcgMCAzMi0xNC4zIDMyLTMycy0xNC4zLTMyLTMyLTMyTDMyIDMyek02NCAzNTJjMC0xNy43LTE0LjMtMzItMzItMzJzLTMyIDE0LjMtMzIgMzJsMCA5NmMwIDE3LjcgMTQuMyAzMiAzMiAzMmw5NiAwYzE3LjcgMCAzMi0xNC4zIDMyLTMycy0xNC4zLTMyLTMyLTMybC02NCAwIDAtNjR6TTMyMCAzMmMtMTcuNyAwLTMyIDE0LjMtMzIgMzJzMTQuMyAzMiAzMiAzMmw2NCAwIDAgNjRjMCAxNy43IDE0LjMgMzIgMzIgMzJzMzItMTQuMyAzMi0zMmwwLTk2YzAtMTcuNy0xNC4zLTMyLTMyLTMybC05NiAwek00NDggMzUyYzAtMTcuNy0xNC4zLTMyLTMyLTMycy0zMiAxNC4zLTMyIDMybDAgNjQtNjQgMGMtMTcuNyAwLTMyIDE0LjMtMzIgMzJzMTQuMyAzMiAzMiAzMmw5NiAwYzE3LjcgMCAzMi0xNC4zIDMyLTMybDAtOTZ6Ii8+PC9zdmc+");
|
|
83
|
+
display: flex;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
align-items: center;
|
|
86
|
+
width: 24px;
|
|
87
|
+
height: 24px;
|
|
88
|
+
margin: 0 auto;
|
|
89
|
+
cursor: pointer;
|
|
90
|
+
}
|
|
91
|
+
</style>
|
|
92
|
+
</head>
|
|
93
|
+
<body>
|
|
94
|
+
<!-- All the styles are in the pd4web.style.css file loaded by pd4web.js -->
|
|
95
|
+
<div style="display: flex; justify-content: center; width: 100%; height: 100vh; margin-top: 20px">
|
|
96
|
+
<div style="width: 30%">
|
|
97
|
+
<div style="display: flex; justify-content: center">
|
|
98
|
+
<span class="pd4web-sound-switch" id="Pd4WebAudioSwitch"></span>
|
|
99
|
+
<span class="pd4web-fullscreen" id="Pd4WebFullscreen"></span>
|
|
100
|
+
</div>
|
|
101
|
+
<hr />
|
|
102
|
+
<div id="Pd4WebPatchDiv" class="Pd4WebPatchDiv">
|
|
103
|
+
<svg id="Pd4WebCanvas"></svg>
|
|
104
|
+
</div>
|
|
105
|
+
<div id="Pd4WebText"></div>
|
|
106
|
+
</div>
|
|
107
|
+
<div style="width: 70%; margin: 0 auto; text-align: center">
|
|
108
|
+
<img id="Pd4WebScore" src="score1.png" style="width: 100%; max-width: 100%" />
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
<script>
|
|
112
|
+
async function loadMarkdown() {
|
|
113
|
+
try {
|
|
114
|
+
const response = await fetch("bula.md");
|
|
115
|
+
if (!response.ok) throw new Error("Failed to load file.md");
|
|
116
|
+
const markdown = await response.text();
|
|
117
|
+
const html = marked.parse(markdown);
|
|
118
|
+
document.getElementById("Pd4WebText").innerHTML = html;
|
|
119
|
+
} catch (error) {
|
|
120
|
+
console.error("Error loading Markdown:", error);
|
|
121
|
+
document.getElementById("Pd4WebText").innerText = "Failed to load content.";
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
window.onload = loadMarkdown;
|
|
125
|
+
|
|
126
|
+
// when user click pd4web-fullscreen, the patch will be displayed in full screen
|
|
127
|
+
document.getElementById("Pd4WebFullscreen").addEventListener("click", () => {
|
|
128
|
+
// check if already in full screen
|
|
129
|
+
if (document.fullscreenElement) {
|
|
130
|
+
document.exitFullscreen();
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
document.documentElement.requestFullscreen();
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
var Pd4Web = null; // Pd4Web object must be declared in the global scope
|
|
137
|
+
Pd4WebModule().then((Pd4WebModulePromise) => {
|
|
138
|
+
Pd4Web = new Pd4WebModulePromise.Pd4Web();
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
document.getElementById("Pd4WebAudioSwitch").addEventListener("click", async () => {
|
|
142
|
+
// Pd4Web.init(), when using audio input, must be called after a user gesture
|
|
143
|
+
Pd4Web.init();
|
|
144
|
+
|
|
145
|
+
Pd4Web.onSymbolReceived("pd4web-score", function (symbol) {
|
|
146
|
+
document.getElementById("Pd4WebScore").src = symbol;
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
</script>
|
|
150
|
+
</body>
|
|
151
|
+
</html>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<title>Pd4Web</title>
|
|
5
|
+
<script data-goatcounter="https://pd4web.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>
|
|
6
|
+
<meta charset="UTF-8" />
|
|
7
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.1/p5.min.js"></script>
|
|
8
|
+
<script src="https://unpkg.com/ml5@1/dist/ml5.js"></script>
|
|
9
|
+
<script src="./pd4web.threads.js"></script>
|
|
10
|
+
<script src="./pd4web.js"></script>
|
|
11
|
+
<script src="./sketch.js"></script>
|
|
12
|
+
<style>
|
|
13
|
+
canvas {
|
|
14
|
+
border-radius: 30px;
|
|
15
|
+
}
|
|
16
|
+
</style>
|
|
17
|
+
</head>
|
|
18
|
+
<body>
|
|
19
|
+
<span class="pd4web-sound-switch" id="Pd4WebAudioSwitch"></span>
|
|
20
|
+
<div id="Pd4WebPatchDiv" class="Pd4WebPatchDiv">
|
|
21
|
+
<svg id="Pd4WebCanvas"></svg>
|
|
22
|
+
</div>
|
|
23
|
+
<hr />
|
|
24
|
+
<p id="message" style="text-align: center; font-size: 20px">
|
|
25
|
+
Click on the page to request access to the camera and microphone.
|
|
26
|
+
</p>
|
|
27
|
+
<div style="display: flex; justify-content: center; border-radius: 30px">
|
|
28
|
+
<div id="p5js" style="border-radius: 30px"></div>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<script>
|
|
32
|
+
// ╭─────────────────────────────────────╮
|
|
33
|
+
// │ Gui Bottoms Interface │
|
|
34
|
+
// ╰─────────────────────────────────────╯
|
|
35
|
+
var Pd4Web = null;
|
|
36
|
+
|
|
37
|
+
// add window click event to start video
|
|
38
|
+
document.addEventListener("click", async () => {
|
|
39
|
+
navigator.mediaDevices.getUserMedia({
|
|
40
|
+
video: true,
|
|
41
|
+
audio: true,
|
|
42
|
+
});
|
|
43
|
+
if (Pd4Web) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
Pd4WebModule().then((Pd4WebModulePromise) => {
|
|
47
|
+
Pd4Web = new Pd4WebModulePromise.Pd4Web();
|
|
48
|
+
const message = document.getElementById("message");
|
|
49
|
+
if (message) {
|
|
50
|
+
message.style.display = "none";
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
// remove event listener
|
|
54
|
+
document.removeEventListener("click", () => {});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
document.getElementById("Pd4WebAudioSwitch").addEventListener("click", async () => {
|
|
58
|
+
startVideo();
|
|
59
|
+
Pd4Web.init();
|
|
60
|
+
console.log("Pd4Web", Pd4Web);
|
|
61
|
+
});
|
|
62
|
+
</script>
|
|
63
|
+
</body>
|
|
64
|
+
</html>
|