pd4web 2.0.10rc3__tar.gz → 2.1.0.dev5__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.
Files changed (64) hide show
  1. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/PKG-INFO +2 -2
  2. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/README.md +1 -1
  3. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/Libraries.yaml +32 -3
  4. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/cyclone.cmake +3 -3
  5. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/else.cmake +10 -2
  6. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/libpd.cmake +6 -1
  7. pd4web-2.1.0.dev5/Sources/Templates/1/bula.md +10 -0
  8. pd4web-2.1.0.dev5/Sources/Templates/1/index.html +158 -0
  9. pd4web-2.1.0.dev5/Sources/Templates/2/index.html +66 -0
  10. pd4web-2.1.0.dev5/Sources/Templates/2/sketch.js +55 -0
  11. pd4web-2.1.0.dev5/Sources/index.html +30 -0
  12. pd4web-2.1.0.dev5/Sources/nogui.html +29 -0
  13. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/pd4web/Builder.py +61 -67
  14. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/pd4web/Compilers.py +1 -2
  15. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/pd4web/Libraries.py +8 -48
  16. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/pd4web/Objects.py +10 -3
  17. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/pd4web/Patch.py +196 -82
  18. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/pd4web/Pd4Web.py +40 -2
  19. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/pd4web.cpp +116 -18
  20. pd4web-2.1.0.dev5/Sources/pd4web.gui.js +2610 -0
  21. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/pd4web.hpp +7 -1
  22. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/pd4web.style.css +282 -119
  23. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/pyproject.toml +1 -2
  24. pd4web-2.0.10rc3/Sources/Templates/Template1.html +0 -128
  25. pd4web-2.0.10rc3/Sources/index.html +0 -128
  26. pd4web-2.0.10rc3/Sources/pd4web/Emscripten.py +0 -58
  27. pd4web-2.0.10rc3/Sources/pd4web.gui.js +0 -1930
  28. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/LICENSE +0 -0
  29. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/.clang-format +0 -0
  30. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/.prettierrc +0 -0
  31. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/.yamlftm +0 -0
  32. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/ambi~.cmake +0 -0
  33. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/earplug.cmake +0 -0
  34. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/o.scofo~.cmake +0 -0
  35. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/pd.cmake/.git +0 -0
  36. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/pd.cmake/.github/workflows/c-cpp.yml +0 -0
  37. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/pd.cmake/.gitignore +0 -0
  38. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/pd.cmake/CMakeLists.txt +0 -0
  39. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/pd.cmake/Examples/.clang-format +0 -0
  40. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/pd.cmake/Examples/CMakeLists.txt +0 -0
  41. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/pd.cmake/Examples/fft~/fft~-help.pd +0 -0
  42. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/pd.cmake/Examples/fft~/fft~.cpp +0 -0
  43. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/pd.cmake/Examples/simple/simple-help.pd +0 -0
  44. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/pd.cmake/Examples/simple/simple-patch.pd +0 -0
  45. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/pd.cmake/Examples/simple/simple.cpp +0 -0
  46. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/pd.cmake/Examples/simple~/simple~-help.pd +0 -0
  47. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/pd.cmake/Examples/simple~/simple~.cpp +0 -0
  48. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/pd.cmake/LICENSE +0 -0
  49. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/pd.cmake/README.md +0 -0
  50. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/pd.cmake/Tests/01.Deprecated-Functions/CMakeLists.txt +0 -0
  51. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/pd.cmake/Tests/CMakeLists.txt +0 -0
  52. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/pd.cmake/pd.cmake +0 -0
  53. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/pmpd.cmake +0 -0
  54. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/Libraries/timbreIDLib.cmake +0 -0
  55. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/__init__.py +0 -0
  56. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/cmake-format.yaml +0 -0
  57. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/config.h +0 -0
  58. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/externals.cpp +0 -0
  59. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/favicon.ico +0 -0
  60. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/pd4web/Helpers.py +0 -0
  61. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/pd4web/__init__.py +0 -0
  62. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/pd4web.gitignore +0 -0
  63. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/pd4web.midi.js +0 -0
  64. {pd4web-2.0.10rc3 → pd4web-2.1.0.dev5}/Sources/pd4web.threads.js +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pd4web
3
- Version: 2.0.10rc3
3
+ Version: 2.1.0.dev5
4
4
  Summary: pd4web compiles PureData patches with external objects for Wasm, allowing to run entire patches in web browsers.
5
5
  Home-page: https://charlesneimog.github.io/pd4web
6
6
  Author: Charles K. Neimog
@@ -50,7 +50,7 @@ Description-Content-Type: text/markdown
50
50
 
51
51
  <h3 align="center">Examples</h3>
52
52
 
53
- * Check some examples [here](https://charlesneimog.github.io/pd4web/tests/).
53
+ * Check some examples [here](https://charlesneimog.github.io/pd4web/).
54
54
 
55
55
  -----
56
56
  <h3 align="center">Questions, doubts, help</h3>
@@ -27,7 +27,7 @@
27
27
 
28
28
  <h3 align="center">Examples</h3>
29
29
 
30
- * Check some examples [here](https://charlesneimog.github.io/pd4web/tests/).
30
+ * Check some examples [here](https://charlesneimog.github.io/pd4web/).
31
31
 
32
32
  -----
33
33
  <h3 align="center">Questions, doubts, help</h3>
@@ -23,7 +23,22 @@ Libraries:
23
23
  Developer: porres
24
24
  Repository: pd-cyclone
25
25
  Version: cyclone_0.9-1
26
- Unsupported: [active, mousefilter, mousestate, scope~, coll, mtr, capture, hrandfile, prob, funbuff, seq, hrandgrowfile, hrandfile, capture~, table]
26
+ Unsupported:
27
+ - active
28
+ - mousefilter
29
+ - mousestate
30
+ - scope~
31
+ - coll
32
+ - mtr
33
+ - capture
34
+ - hrandfile
35
+ - prob
36
+ - funbuff
37
+ - seq
38
+ - hrandgrowfile
39
+ - hrandfile
40
+ - capture~
41
+ - table
27
42
 
28
43
  # ─────────────── o.scofo~ ───────────────
29
44
  - Name: ambi~
@@ -51,17 +66,21 @@ Libraries:
51
66
  Source: GITHUB
52
67
  Developer: porres
53
68
  Repository: pd-else
54
- Version: faa72218e7290769b689cddc9b66ae0db5c2faaa
69
+ Version: v.1.0-rc12
55
70
  Unsupported:
56
71
  # Need implementation
57
72
  - sfz~
58
73
  - sfont~
74
+ - play.file~
75
+ - sfload
76
+
77
+ # Osc is not support on browsers
59
78
 
60
79
  # Pd GUI Related
61
80
  - oscope~
62
81
  - midi
63
82
  - numbox~
64
- - keyboard
83
+ # - keyboard
65
84
  - pic
66
85
  - bicoeff
67
86
  - function
@@ -79,5 +98,15 @@ Libraries:
79
98
  - bl.imp2~
80
99
  - slew2~
81
100
  - bl.imp~
101
+
82
102
  # Incompatible with Web enviroment
83
103
  - osc.format
104
+ - osc.send
105
+ - pdlink
106
+ - pdlink~
107
+ - keymap
108
+ - properties
109
+
110
+ # need extra objects
111
+ - pvoc.freeze~
112
+ - freeze~
@@ -185,7 +185,7 @@ pd_add_external(rminus~ "${LIB_DIR}/cyclone_objects/binaries/audio/rminus.c")
185
185
  pd_add_external(round~ "${LIB_DIR}/cyclone_objects/binaries/audio/round.c")
186
186
  pd_add_external(scale~ "${LIB_DIR}/cyclone_objects/binaries/audio/scale.c")
187
187
  pd_add_external(thresh~ "${LIB_DIR}/cyclone_objects/binaries/audio/thresh.c")
188
- pd_add_external(trunc~ "${LIB_DIR}/cyclone_objects/binaries/audio/trunc.c")
188
+ #pd_add_external(trunc~ "${LIB_DIR}/cyclone_objects/binaries/audio/trunc.c")
189
189
 
190
190
  # ╭──────────────────────────────────────╮
191
191
  # │ Classes with Dependencies │
@@ -245,7 +245,7 @@ pd_add_external(decide "${LIB_DIR}/cyclone_objects/binaries/control/decide.c;${L
245
245
 
246
246
  # New dependencies for rand~ and pink~
247
247
  pd_add_external(rand~ "${LIB_DIR}/cyclone_objects/binaries/audio/rand.c;${LIB_DIR}/shared/common/random.c")
248
- pd_add_external(pink~ "${LIB_DIR}/cyclone_objects/binaries/audio/pink.c;${LIB_DIR}/shared/common/random.c")
248
+ #pd_add_external(pink~ "${LIB_DIR}/cyclone_objects/binaries/audio/pink.c;${LIB_DIR}/shared/common/random.c")
249
249
 
250
250
  # New dependencies for frameaccum~ and framedelta~
251
251
  pd_add_external(frameaccum~ "${LIB_DIR}/cyclone_objects/binaries/audio/frameaccum.c;${LIB_DIR}/shared/common/grow.c")
@@ -274,7 +274,7 @@ pd_add_external(bitshift~ "${LIB_DIR}/cyclone_objects/binaries/audio/bitshift.c;
274
274
  pd_add_external(bitxor~ "${LIB_DIR}/cyclone_objects/binaries/audio/bitxor.c;${LIB_DIR}/shared/common/magicbit.c")
275
275
 
276
276
  # New dependency for scope~
277
- pd_add_external(scope~ "${LIB_DIR}/cyclone_objects/binaries/audio/scope.c;${LIB_DIR}/shared/common/magicbit.c")
277
+ #pd_add_external(scope~ "${LIB_DIR}/cyclone_objects/binaries/audio/scope.c;${LIB_DIR}/shared/common/magicbit.c")
278
278
 
279
279
  # New dependency for comment
280
280
  pd_add_external(comment "${LIB_DIR}/cyclone_objects/binaries/control/comment.c;${LIB_DIR}/shared/control/s_cycloneutf8.c")
@@ -229,13 +229,15 @@ pd_add_external(toggleff~ "${LIB_DIR}/Source/Audio/toggleff~.c")
229
229
  pd_add_external(trighold~ "${LIB_DIR}/Source/Audio/trighold~.c")
230
230
  pd_add_external(unmerge~ "${LIB_DIR}/Source/Audio/unmerge~.c")
231
231
  pd_add_external(vu~ "${LIB_DIR}/Source/Audio/vu~.c")
232
- # pd_add_external(vcf2~ "${LIB_DIR}/Source/Audio/vcf2~.c")
232
+ pd_add_external(vcf2~ "${LIB_DIR}/Source/Audio/vcf2~.c")
233
233
  pd_add_external(xmod~ "${LIB_DIR}/Source/Audio/xmod~.c")
234
234
  pd_add_external(xmod2~ "${LIB_DIR}/Source/Audio/xmod2~.c")
235
235
  pd_add_external(wrap2 "${LIB_DIR}/Source/Control/wrap2.c")
236
236
  pd_add_external(wrap2~ "${LIB_DIR}/Source/Audio/wrap2~.c")
237
237
  pd_add_external(zerocross~ "${LIB_DIR}/Source/Audio/zerocross~.c")
238
238
 
239
+
240
+
239
241
  # ╭──────────────────────────────────────╮
240
242
  # │ AUBIO │
241
243
  # ╰──────────────────────────────────────╯
@@ -338,6 +340,7 @@ pd_add_external(gendyn~ "${LIB_DIR}/Source/Audio/gendyn~.c;${randbuf}")
338
340
  list(APPEND randmagic ${MAGIC_CODE})
339
341
  list(APPEND randmagic "${LIB_DIR}/Source/Shared/random.c")
340
342
  pd_add_external(brown~ "${LIB_DIR}/Source/Audio/brown~.c;${randmagic}")
343
+ pd_add_external(velvet~ "${LIB_DIR}/Source/Audio/velvet~.c;${randmagic}")
341
344
 
342
345
  # ╭──────────────────────────────────────╮
343
346
  # │ RAND │
@@ -399,7 +402,7 @@ pd_add_external(plaits~ "${PLAITS_SRC}")
399
402
  # ╭──────────────────────────────────────╮
400
403
  # │ SFONT │
401
404
  # ╰──────────────────────────────────────╯
402
- if(NOT PD4WEB)
405
+ if(NOT EMSCRIPTEN)
403
406
  set(BUILD_SFONT ON)
404
407
  if(BUILD_SFONT)
405
408
 
@@ -507,3 +510,8 @@ if(WIN32)
507
510
  endif()
508
511
 
509
512
  add_definitions(-DHAVE_STRUCT_TIMESPEC)
513
+
514
+
515
+ #add_subdirectory("${LIB_DIR}/Source/Shared/ffmpeg")
516
+ #pd_add_external(play.file~ "${LIB_DIR}/Source/Audio/play.file~.c")
517
+ #target_link_libraries(play.file_tilde PUBLIC ffmpeg)
@@ -2,7 +2,12 @@ cmake_minimum_required(VERSION 3.25)
2
2
  project(libpd C)
3
3
 
4
4
  set(ENABLE_TILDE_TARGET_WARNING off)
5
- set(PD_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Pd4Web/pure-data/src/)
5
+
6
+ if (LSP_SUPPORT)
7
+ set(PD_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/build/pure-data/src/)
8
+ else()
9
+ set(PD_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Pd4Web/pure-data/src/)
10
+ endif()
6
11
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread -matomics -mbulk-memory")
7
12
 
8
13
  # ╭──────────────────────────────────────╮
@@ -0,0 +1,10 @@
1
+ # by ChatGpt
2
+
3
+ "Spectral Echoes" is an immersive electroacoustic composition that blends live instruments with pre-recorded electronic sounds and real-time audio processing. To ensure the best experience, follow these setup and performance instructions:
4
+
5
+ ## Equipment Needed
6
+
7
+ * Audio Interface: A multi-channel audio interface.
8
+ * Speakers: A quadraphonic speaker setup (four speakers positioned in a square around the audience) for spatial audio diffusion.
9
+ * Microphones: One or two condenser microphones for capturing live instruments.
10
+ * Cables: Ensure all necessary audio cables (XLR, TRS, and USB) are available.
@@ -0,0 +1,158 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <title>Pd4Web</title>
5
+ <meta charset="UTF-8" />
6
+ <!-- pd4web.threads.js can help if you can't active Cross-Origin Resource Sharing (CORS) from server side -->
7
+ <script src="./pd4web.threads.js"></script>
8
+ <script src="./pd4web.js"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
10
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css">
11
+ <style>
12
+ /* Style for the entire Markdown content container */
13
+ #Pd4WebText {
14
+ font-family: Arial, sans-serif;
15
+ line-height: 1.6;
16
+ padding: 20px;
17
+ border-radius: 8px;
18
+ text-align: center;
19
+ }
20
+
21
+ /* Style for h1 tags inside #Pd4WebText */
22
+ #Pd4WebText h1 {
23
+ font-size: 2em;
24
+ color: #2c3e50;
25
+ margin-bottom: 0.5em;
26
+ padding-bottom: 0.3em;
27
+ text-align: center;
28
+ user-select: none;
29
+ }
30
+
31
+ /* Style for h2 tags inside #Pd4WebText */
32
+ #Pd4WebText h2 {
33
+ font-size: 1.75em;
34
+ color: #34495e;
35
+ margin-top: 1em;
36
+ margin-bottom: 0.5em;
37
+ text-align: center;
38
+ user-select: none;
39
+ }
40
+
41
+ /* Style for paragraph tags inside #Pd4WebText */
42
+ #Pd4WebText p {
43
+ font-size: 1.5em;
44
+ color: #000000;
45
+ margin-bottom: 1em;
46
+ text-align: justify;
47
+ user-select: none;
48
+ }
49
+
50
+ /* Style for lists */
51
+ #Pd4WebText ul {
52
+ list-style-type: disc;
53
+ margin-left: 20px;
54
+ margin-bottom: 1em;
55
+ text-align: left;
56
+ }
57
+
58
+ #Pd4WebText ol {
59
+ list-style-type: decimal;
60
+ margin-left: 1px;
61
+ margin-bottom: 1em;
62
+ font-size: 1.5em;
63
+ text-align: left;
64
+ }
65
+
66
+ #Pd4WebText ul {
67
+ list-style-type: disc; /* Use a disc (default bullet) */
68
+ margin-left: 2px;
69
+ padding-left: 0px;
70
+ font-size: 1.2em;
71
+ }
72
+
73
+ /* Style for each list item */
74
+ #Pd4WebText li {
75
+ font-size: 1.2em;
76
+ color: #000000; /* Dark gray color */
77
+ margin-bottom: 0.5em; /* Space between items */
78
+ }
79
+
80
+ .pd4web-fullscreen {
81
+ content: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzIiIHdpZHRoPSIyOCIgdmlld0JveD0iMCAwIDQ0OCA1MTIiPjwhLS0hRm9udCBBd2Vzb21lIEZyZWUgNi42LjAgYnkgQGZvbnRhd2Vzb21lIC0gaHR0cHM6Ly9mb250YXdlc29tZS5jb20gTGljZW5zZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tL2xpY2Vuc2UvZnJlZSBDb3B5cmlnaHQgMjAyNCBGb250aWNvbnMsIEluYy4tLT48cGF0aCBkPSJNMzIgMzJDMTQuMyAzMiAwIDQ2LjMgMCA2NGwwIDk2YzAgMTcuNyAxNC4zIDMyIDMyIDMyczMyLTE0LjMgMzItMzJsMC02NCA2NCAwYzE3LjcgMCAzMi0xNC4zIDMyLTMycy0xNC4zLTMyLTMyLTMyTDMyIDMyek02NCAzNTJjMC0xNy43LTE0LjMtMzItMzItMzJzLTMyIDE0LjMtMzIgMzJsMCA5NmMwIDE3LjcgMTQuMyAzMiAzMiAzMmw5NiAwYzE3LjcgMCAzMi0xNC4zIDMyLTMycy0xNC4zLTMyLTMyLTMybC02NCAwIDAtNjR6TTMyMCAzMmMtMTcuNyAwLTMyIDE0LjMtMzIgMzJzMTQuMyAzMiAzMiAzMmw2NCAwIDAgNjRjMCAxNy43IDE0LjMgMzIgMzIgMzJzMzItMTQuMyAzMi0zMmwwLTk2YzAtMTcuNy0xNC4zLTMyLTMyLTMybC05NiAwek00NDggMzUyYzAtMTcuNy0xNC4zLTMyLTMyLTMycy0zMiAxNC4zLTMyIDMybDAgNjQtNjQgMGMtMTcuNyAwLTMyIDE0LjMtMzIgMzJzMTQuMyAzMiAzMiAzMmw5NiAwYzE3LjcgMCAzMi0xNC4zIDMyLTMybDAtOTZ6Ii8+PC9zdmc+");
82
+ display: flex;
83
+ justify-content: center;
84
+ align-items: center;
85
+ width: 24px;
86
+ height: 24px;
87
+ margin: 0 auto;
88
+ cursor: pointer;
89
+ }
90
+ </style>
91
+ </head>
92
+ <body>
93
+ <!-- All the styles are in the pd4web.style.css file loaded by pd4web.js -->
94
+ <div style="display: flex; justify-content: center; width: 100%; height: 100vh; margin-top: 20px;">
95
+ <div style="width: 30%;">
96
+ <div style="display: flex; justify-content: center;">
97
+ <span class="pd4web-sound-switch" id="Pd4WebAudioSwitch"></span>
98
+ <span class="pd4web-fullscreen" id="Pd4WebFullscreen"></span>
99
+ </div>
100
+ <hr>
101
+ <div id="Pd4WebPatchDiv"class="Pd4WebPatchDiv">
102
+ <svg id="Pd4WebCanvas"></svg>
103
+ </div>
104
+ <div id="Pd4WebText"></div>
105
+ </div>
106
+ <div style="width: 70%; margin: 0 auto; text-align: center;">
107
+ <img id="Pd4WebScore" src="score1.png" style="width: 100%; max-width: 100%;">
108
+ </div>
109
+
110
+
111
+
112
+ </div>
113
+ <script>
114
+ async function loadMarkdown() {
115
+ try {
116
+ const response = await fetch('bula.md');
117
+ if (!response.ok) throw new Error('Failed to load file.md');
118
+ const markdown = await response.text();
119
+ const html = marked.parse(markdown);
120
+ document.getElementById('Pd4WebText').innerHTML = html;
121
+ } catch (error) {
122
+ console.error('Error loading Markdown:', error);
123
+ document.getElementById('Pd4WebText').innerText = 'Failed to load content.';
124
+ }
125
+ }
126
+ window.onload = loadMarkdown;
127
+
128
+ // when user click pd4web-fullscreen, the patch will be displayed in full screen
129
+ document.getElementById("Pd4WebFullscreen").addEventListener("click", () => {
130
+ // check if already in full screen
131
+ if (document.fullscreenElement) {
132
+ document.exitFullscreen();
133
+ return;
134
+ }
135
+ document.documentElement.requestFullscreen();
136
+
137
+ });
138
+
139
+
140
+ var Pd4Web = null; // Pd4Web object must be declared in the global scope
141
+ Pd4WebModule().then((Pd4WebModulePromise) => {
142
+ Pd4Web = new Pd4WebModulePromise.Pd4Web();
143
+ });
144
+
145
+ document
146
+ .getElementById("Pd4WebAudioSwitch")
147
+ .addEventListener("click", async () => {
148
+ // Pd4Web.init(), when using audio input, must be called after a user gesture
149
+ Pd4Web.init();
150
+
151
+ Pd4Web.onSymbolReceived("pd4web-score", function (symbol) {
152
+ document.getElementById("Pd4WebScore").src = symbol;
153
+ });
154
+
155
+ });
156
+ </script>
157
+ </body>
158
+ </html>
@@ -0,0 +1,66 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <title>Pd4Web</title>
5
+ <meta charset="UTF-8" />
6
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.1/p5.min.js"></script>
7
+ <script src="https://unpkg.com/ml5@1/dist/ml5.js"></script>
8
+ <script src="./pd4web.threads.js"></script>
9
+ <script src="./pd4web.js"></script>
10
+ <script src="./sketch.js"></script>
11
+ <style>
12
+ canvas {
13
+ border-radius: 30px;
14
+ }
15
+ </style>
16
+ </head>
17
+ <body>
18
+ <span class="pd4web-sound-switch" id="Pd4WebAudioSwitch"></span>
19
+ <div id="Pd4WebPatchDiv"class="Pd4WebPatchDiv">
20
+ <svg id="Pd4WebCanvas"></svg>
21
+ </div>
22
+ <hr>
23
+ <p id="message" style="text-align: center; font-size: 20px">
24
+ Click on the page to request access to the camera and microphone.
25
+ </p>
26
+ <div style="display: flex; justify-content: center; border-radius: 30px">
27
+ <div id="p5js" style="border-radius: 30px"></div>
28
+ </div>
29
+
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
58
+ .getElementById("Pd4WebAudioSwitch")
59
+ .addEventListener("click", async () => {
60
+ startVideo();
61
+ Pd4Web.init();
62
+ console.log("Pd4Web", Pd4Web);
63
+ });
64
+ </script>
65
+ </body>
66
+ </html>
@@ -0,0 +1,55 @@
1
+ let handPose;
2
+ let hands = [];
3
+ var p5jsConfigured = false;
4
+ let video;
5
+ let canvas;
6
+
7
+ function preload() {
8
+ handPose = ml5.handPose({ flipped: true });
9
+ }
10
+
11
+ function mousePressed() {
12
+ console.log(hands);
13
+ }
14
+
15
+ function gotHands(results) {
16
+ hands = results;
17
+ }
18
+
19
+ function setup() {
20
+ canvas = createCanvas(640, 480);
21
+ canvas.parent("p5js");
22
+ noLoop();
23
+ }
24
+
25
+ function startVideo() {
26
+ video = createCapture(VIDEO, { flipped: true });
27
+ video.hide();
28
+ handPose.detectStart(video, gotHands);
29
+ loop(); // Restart draw loop to start rendering video frames
30
+ }
31
+
32
+ function draw() {
33
+ // Draw the webcam video
34
+ image(video, 0, 0, width, height);
35
+
36
+ // Draw all the tracked hand points
37
+ for (let i = 0; i < hands.length; i++) {
38
+ let hand = hands[i];
39
+ for (let j = 0; j < hand.keypoints.length; j++) {
40
+ let keypoint = hand.keypoints[j];
41
+ let whichHand = hand.handedness;
42
+ fill(255, 0, 0);
43
+ noStroke();
44
+ circle(keypoint.x, keypoint.y, 5);
45
+ if (Pd4Web){
46
+ let x = keypoint.x / width;
47
+ let y = keypoint.y / height;
48
+ // check if sendList is available
49
+ if (Pd4Web.sendList){
50
+ Pd4Web.sendList(whichHand[0] + "-" + j, [x, y]);
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
@@ -0,0 +1,30 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <title>Pd4Web</title>
5
+ <meta charset="UTF-8" />
6
+ <!-- pd4web.threads.js can help if you can't active Cross-Origin Resource Sharing (CORS) from server side -->
7
+ <script src="./pd4web.threads.js"></script>
8
+ <script src="./pd4web.js"></script>
9
+ </head>
10
+ <body>
11
+ <!-- All the styles are in the pd4web.style.css file loaded by pd4web.js -->
12
+ <span class="pd4web-sound-switch" id="Pd4WebAudioSwitch"></span>
13
+ <div id="Pd4WebPatchDiv"class="Pd4WebPatchDiv">
14
+ <svg id="Pd4WebCanvas"></svg>
15
+ </div>
16
+ <script>
17
+ var Pd4Web = null; // Pd4Web object must be declared in the global scope
18
+ Pd4WebModule().then((Pd4WebModulePromise) => {
19
+ Pd4Web = new Pd4WebModulePromise.Pd4Web();
20
+ });
21
+
22
+ document
23
+ .getElementById("Pd4WebAudioSwitch")
24
+ .addEventListener("click", async () => {
25
+ // Pd4Web.init(), when using audio input, must be called after a user gesture
26
+ Pd4Web.init();
27
+ });
28
+ </script>
29
+ </body>
30
+ </html>
@@ -0,0 +1,29 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <title>Pd4Web</title>
5
+ <meta charset="UTF-8" />
6
+ <!-- pd4web.threads.js can help if you can't active Cross-Origin Resource Sharing (CORS) from server side -->
7
+ <script src="./pd4web.threads.js"></script>
8
+ <script src="./pd4web.js"></script>
9
+ </head>
10
+ <body>
11
+ <script>
12
+ var Pd4Web = null; // Pd4Web object must be declared in the global scope
13
+ Pd4WebModule().then((Pd4WebModulePromise) => {
14
+ Pd4Web = new Pd4WebModulePromise.Pd4Web();
15
+ });
16
+
17
+ // If you are using the "-nogui" option, you need to manually call Pd4Web.init()
18
+ // after a user interaction to enable audio (case you use audio input, from mic). In this example, Pd4Web.init() is
19
+ // triggered by the first click anywhere on the page.
20
+ document.addEventListener(
21
+ "click",
22
+ async () => {
23
+ Pd4Web.init();
24
+ },
25
+ { once: true }, // Ensures this only runs once
26
+ );
27
+ </script>
28
+ </body>
29
+ </html>