Skip to content

Commit 7874ed3

Browse files
authored
Merge branch 'main' into dev-2.0-docs
2 parents f82dadf + 94f263b commit 7874ed3

File tree

97 files changed

+321
-181
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+321
-181
lines changed

parametric-fhp-de.jpg

-165 KB
Binary file not shown.

parametric-fhp-en.jpg

-162 KB
Binary file not shown.

public/reference/data.json

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2744,6 +2744,14 @@
27442744
"line": 10,
27452745
"description": "Get the current volume of a sound.",
27462746
"is_constructor": 1,
2747+
"params": [
2748+
{
2749+
"name": "smoothing",
2750+
"description": "Smooth the amplitude analysis by averaging with the last analysis frame. 0.0 is no time averaging with the last analysis frame.",
2751+
"type": "Number",
2752+
"optional": true
2753+
}
2754+
],
27472755
"example": [
27482756
"\n<div>\n<code>\nlet sound, amp, cnv;\n \nfunction preload() {\n //replace this sound with something local with rights to distribute\n sound = loadSound('/assets/Damscray_DancingTiger.mp3');\n}\n\nfunction setup() {\n cnv = createCanvas(100, 100);\n cnv.mousePressed(playSound);\n textAlign(CENTER);\n fill(255);\n amp = new p5.Amplitude();\n sound.connect(amp);\n}\n\nfunction playSound() {\n sound.play();\n}\n\nfunction draw() {\n let level = amp.getLevel();\n level = map(level, 0, 0.2, 0, 255);\n background(level, 0, 0);\n text('tap to play', width/2, 20);\n describe('The color of the background changes based on the amplitude of the sound.');\n}\n</code>\n</div>"
27492757
]
@@ -25088,7 +25096,7 @@
2508825096
},
2508925097
{
2509025098
"file": "src/Amplitude.js",
25091-
"line": 52,
25099+
"line": 53,
2509225100
"description": "Connect an audio source to the amplitude object.",
2509325101
"itemtype": "method",
2509425102
"name": "setInput",
@@ -25105,7 +25113,7 @@
2510525113
},
2510625114
{
2510725115
"file": "src/Amplitude.js",
25108-
"line": 62,
25116+
"line": 63,
2510925117
"description": "Get the current amplitude value of a sound.",
2511025118
"itemtype": "method",
2511125119
"name": "getLevel",
@@ -25117,6 +25125,23 @@
2511725125
"module": "p5.sound",
2511825126
"submodule": "p5.sound"
2511925127
},
25128+
{
25129+
"file": "src/Amplitude.js",
25130+
"line": 73,
25131+
"description": "Get the current amplitude value of a sound.",
25132+
"itemtype": "method",
25133+
"name": "smooth",
25134+
"params": [
25135+
{
25136+
"name": "Smooth",
25137+
"description": "Amplitude analysis by averaging with the last analysis frame. Off by default.",
25138+
"type": "Number"
25139+
}
25140+
],
25141+
"class": "p5.Amplitude",
25142+
"module": "p5.sound",
25143+
"submodule": "p5.sound"
25144+
},
2512025145
{
2512125146
"file": "src/AudioIn.js",
2512225147
"line": 57,

public/search-indices/en.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

public/search-indices/es.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

public/search-indices/hi.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

public/search-indices/ko.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

public/search-indices/zh-Hans.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/content/examples/en/01_Shapes_And_Color/00_Shape_Primitives/description.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ relatedReference:
1010

1111
This program demonstrates the use of the basic shape
1212
primitive functions
13-
<a href="https://p5js.org/reference/#/p5/square" target="_blank">square()</a>,
14-
<a href="https://p5js.org/reference/#/p5/rect" target="_blank">rect()</a>,
15-
<a href="https://p5js.org/reference/#/p5/ellipse" target="_blank">ellipse()</a>,
16-
<a href="https://p5js.org/reference/#/p5/circle" target="_blank">circle()</a>,
17-
<a href="https://p5js.org/reference/#/p5/arc" target="_blank">arc()</a>,
18-
<a href="https://p5js.org/reference/#/p5/line" target="_blank">line()</a>,
19-
<a href="https://p5js.org/reference/#/p5/triangle" target="_blank">triangle()</a>,
20-
and <a href="https://p5js.org/reference/#/p5/quad" target="_blank">quad()</a>.
13+
<a href="https://p5js.org/reference/p5/square" target="_blank">square()</a>,
14+
<a href="https://p5js.org/reference/p5/rect" target="_blank">rect()</a>,
15+
<a href="https://p5js.org/reference/p5/ellipse" target="_blank">ellipse()</a>,
16+
<a href="https://p5js.org/reference/p5/circle" target="_blank">circle()</a>,
17+
<a href="https://p5js.org/reference/p5/arc" target="_blank">arc()</a>,
18+
<a href="https://p5js.org/reference/p5/line" target="_blank">line()</a>,
19+
<a href="https://p5js.org/reference/p5/triangle" target="_blank">triangle()</a>,
20+
and <a href="https://p5js.org/reference/p5/quad" target="_blank">quad()</a>.

src/content/examples/en/01_Shapes_And_Color/01_Color/description.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ oneLineDescription: Add color to your sketch.
77

88
This expands on the Shape Primitives example by adding
99
color.
10-
<a href="https://p5js.org/reference/#/p5/background" target="_blank">background()</a>
10+
<a href="https://p5js.org/reference/p5/background" target="_blank">background()</a>
1111
fills the canvas with one color,
12-
<a href="https://p5js.org/reference/#/p5/stroke" target="_blank">stroke()</a>
12+
<a href="https://p5js.org/reference/p5/stroke" target="_blank">stroke()</a>
1313
sets the color for drawing lines, and
14-
<a href="https://p5js.org/reference/#/p5/fill" target="_blank">fill()</a>
14+
<a href="https://p5js.org/reference/p5/fill" target="_blank">fill()</a>
1515
sets the color for the inside of shapes.
16-
<a href="https://p5js.org/reference/#/p5/noFill" target="_blank">noStroke()</a> and
17-
<a href="https://p5js.org/reference/#/p5/noFill" target="_blank">noFill()</a>
16+
<a href="https://p5js.org/reference/p5/noFill" target="_blank">noStroke()</a> and
17+
<a href="https://p5js.org/reference/p5/noFill" target="_blank">noFill()</a>
1818
turn off line color and inner color, respectively.
1919

2020
Colors can be represented in many different ways. This example demonstrates several options.

0 commit comments

Comments
 (0)