Skip to content

Commit

Permalink
Merge pull request #602 from limzykenneth/main
Browse files Browse the repository at this point in the history
Update p5.sound reference
  • Loading branch information
limzykenneth authored Oct 16, 2024
2 parents 1494020 + f2ec4f1 commit c4eea2e
Show file tree
Hide file tree
Showing 36 changed files with 579 additions and 118 deletions.
242 changes: 177 additions & 65 deletions public/reference/data.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/content/reference/en/p5.SoundFile/amp.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: amp
module: p5.sound
submodule: p5.sound
submodule: SoundFile
file: src/SoundFile.js
description: Adjust the amplitude of the soundfile.
line: 221
line: 220
isConstructor: false
itemtype: method
class: p5.SoundFile
Expand Down
4 changes: 2 additions & 2 deletions src/content/reference/en/p5.SoundFile/channels.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: channels
module: p5.sound
submodule: p5.sound
submodule: SoundFile
file: src/SoundFile.js
description: Gets the number of channels in the sound file.
line: 435
line: 434
isConstructor: false
itemtype: method
class: p5.SoundFile
Expand Down
4 changes: 2 additions & 2 deletions src/content/reference/en/p5.SoundFile/duration.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: duration
module: p5.sound
submodule: p5.sound
submodule: SoundFile
file: src/SoundFile.js
description: Returns the duration of a sound file in seconds.
line: 298
line: 297
isConstructor: false
itemtype: method
class: p5.SoundFile
Expand Down
6 changes: 3 additions & 3 deletions src/content/reference/en/p5.SoundFile/frames.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: frames
module: p5.sound
submodule: p5.sound
submodule: SoundFile
file: src/SoundFile.js
description: Return the number of samples in a sound file.
line: 391
line: 390
isConstructor: false
itemtype: method
example:
Expand All @@ -15,7 +15,7 @@ example:
let player;
function preload() {
player = loadSound('https://tonejs.github.io/audio/berklee/gong_1.mp3');
player = loadSound('//assets/lucky_dragons_-_power_melody.mp3');
}
function setup() {
Expand Down
4 changes: 2 additions & 2 deletions src/content/reference/en/p5.SoundFile/isLooping.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: isLooping
module: p5.sound
submodule: p5.sound
submodule: SoundFile
file: src/SoundFile.js
description: Return the playback state of the soundfile.
line: 338
line: 337
isConstructor: false
itemtype: method
class: p5.SoundFile
Expand Down
4 changes: 2 additions & 2 deletions src/content/reference/en/p5.SoundFile/isPlaying.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: isPlaying
module: p5.sound
submodule: p5.sound
submodule: SoundFile
file: src/SoundFile.js
description: Return the playback state of the soundfile.
line: 328
line: 327
isConstructor: false
itemtype: method
class: p5.SoundFile
Expand Down
4 changes: 2 additions & 2 deletions src/content/reference/en/p5.SoundFile/jump.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: jump
module: p5.sound
submodule: p5.sound
submodule: SoundFile
file: src/SoundFile.js
description: Move the playhead of a soundfile that is currently playing to a new position.
line: 318
line: 317
isConstructor: false
itemtype: method
class: p5.SoundFile
Expand Down
4 changes: 2 additions & 2 deletions src/content/reference/en/p5.SoundFile/loop.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: loop
module: p5.sound
submodule: p5.sound
submodule: SoundFile
file: src/SoundFile.js
description: Loop the soundfile.
line: 197
line: 196
isConstructor: false
itemtype: method
class: p5.SoundFile
Expand Down
6 changes: 3 additions & 3 deletions src/content/reference/en/p5.SoundFile/onended.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: onended
module: p5.sound
submodule: p5.sound
submodule: SoundFile
file: src/SoundFile.js
description: Define a function to call when the soundfile is done playing.
line: 348
line: 347
isConstructor: false
itemtype: method
example:
Expand All @@ -15,7 +15,7 @@ example:
let player;
function preload() {
player = loadSound('https://tonejs.github.io/audio/berklee/gong_1.mp3');
player = loadSound('//assets/lucky_dragons_-_power_melody.mp3');
}
function setup() {
Expand Down
6 changes: 3 additions & 3 deletions src/content/reference/en/p5.SoundFile/pause.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: pause
module: p5.sound
submodule: p5.sound
submodule: SoundFile
file: src/SoundFile.js
description: Pause the soundfile.
line: 148
line: 147
isConstructor: false
itemtype: method
example:
Expand All @@ -15,7 +15,7 @@ example:
let player;
function preload() {
player = loadSound('https://tonejs.github.io/audio/berklee/gong_1.mp3');
player = loadSound('//assets/Damscray_DancingTiger.mp3');
}
function setup() {
Expand Down
4 changes: 2 additions & 2 deletions src/content/reference/en/p5.SoundFile/play.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: play
module: p5.sound
submodule: p5.sound
submodule: SoundFile
file: src/SoundFile.js
description: Start the soundfile.
line: 125
line: 124
isConstructor: false
itemtype: method
class: p5.SoundFile
Expand Down
4 changes: 2 additions & 2 deletions src/content/reference/en/p5.SoundFile/rate.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: rate
module: p5.sound
submodule: p5.sound
submodule: SoundFile
file: src/SoundFile.js
description: Set the playback rate of the soundfile.
line: 287
line: 286
isConstructor: false
itemtype: method
class: p5.SoundFile
Expand Down
4 changes: 2 additions & 2 deletions src/content/reference/en/p5.SoundFile/sampleRate.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: sampleRate
module: p5.sound
submodule: p5.sound
submodule: SoundFile
file: src/SoundFile.js
description: Gets the number of channels in the sound file.
line: 425
line: 424
isConstructor: false
itemtype: method
class: p5.SoundFile
Expand Down
4 changes: 2 additions & 2 deletions src/content/reference/en/p5.SoundFile/setLoop.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: setLoop
module: p5.sound
submodule: p5.sound
submodule: SoundFile
file: src/SoundFile.js
description: >-
Set a loop region, and optionally a playback rate, and amplitude for the
soundfile.
line: 207
line: 206
isConstructor: false
itemtype: method
class: p5.SoundFile
Expand Down
8 changes: 4 additions & 4 deletions src/content/reference/en/p5.SoundFile/setPath.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: setPath
module: p5.sound
submodule: p5.sound
submodule: SoundFile
file: src/SoundFile.js
description: Change the path for the soundfile.
line: 232
line: 231
isConstructor: false
itemtype: method
example:
Expand All @@ -15,7 +15,7 @@ example:
let soundSource, cnv, btn;
function preload() {
soundSource = loadSound('https://tonejs.github.io/audio/berklee/gong_1.mp3');
soundSource = loadSound('//assets/Damscray_-_Dancing_Tiger_01.mp3');
}
function setup() {
Expand All @@ -40,7 +40,7 @@ example:
function setNewPath() {
background(220);
text('a new sound was loaded', 0, 20, 100);
soundSource.setPath('https://tonejs.github.io/audio/berklee/gong_2.mp3', playSound);
soundSource.setPath('//assets/Damscray_-_Dancing_Tiger_02.mp3', playSound);
}
</code>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/content/reference/en/p5.SoundFile/start.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: start
module: p5.sound
submodule: p5.sound
submodule: SoundFile
file: src/SoundFile.js
description: Start the soundfile.
line: 112
line: 111
isConstructor: false
itemtype: method
class: p5.SoundFile
Expand Down
4 changes: 2 additions & 2 deletions src/content/reference/en/p5.SoundFile/stop.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: stop
module: p5.sound
submodule: p5.sound
submodule: SoundFile
file: src/SoundFile.js
description: Stop the soundfile.
line: 138
line: 137
isConstructor: false
itemtype: method
class: p5.SoundFile
Expand Down
18 changes: 18 additions & 0 deletions src/content/reference/en/p5.sound/getAudioContext.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: getAudioContext
module: Sound
submodule: Sound Utilities
file: src/Utils.js
description: Get the window's audio context.
line: 14
isConstructor: false
itemtype: method
class: p5.sound
return:
description: the audio context
type: AudioContext
chainable: false
---


# getAudioContext
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: loadSound
module: p5.sound
submodule: p5.sound
submodule: SoundFile
file: src/SoundFile.js
description: |-
loadSound() returns a new SoundFile from a specified
Expand All @@ -11,7 +11,7 @@ description: |-
loadSound accepts a callback as the second parameter. Using a
<a href="https://github.com/processing/p5.js/wiki/Local-server/">
local server</a> is recommended when loading external files.
line: 13
line: 12
isConstructor: false
itemtype: method
example:
Expand All @@ -20,7 +20,7 @@ example:
<div><code>
let mySound;
function preload() {
mySound = loadSound('/assets/doorbell');
mySound = loadSound('//assets/doorbell.mp3');
}
function setup() {
Expand All @@ -36,7 +36,7 @@ example:
mySound.play();
}
</code></div>
class: p5.p5sound
class: p5.sound
params:
- name: path
description: |-
Expand Down
2 changes: 1 addition & 1 deletion src/content/reference/en/p5.sound/p5.Amplitude.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ example:
function preload() {
//replace this sound with something local with rights to distribute
sound = loadSound('https://tonejs.github.io/audio/berklee/gong_1.mp3');
sound = loadSound('//assets/Damscray_DancingTiger.mp3');
}
function setup() {
Expand Down
2 changes: 1 addition & 1 deletion src/content/reference/en/p5.sound/p5.Panner.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ example:
let panner, lfo, soundfile, cnv;
function preload() {
soundfile = loadSound('https://tonejs.github.io/audio/berklee/gong_1.mp3');
soundfile = loadSound('//assets/beat.mp3');
}
function setup() {
Expand Down
4 changes: 2 additions & 2 deletions src/content/reference/en/p5.sound/p5.Panner3D.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ example:
let vZ;
function preload() {
soundSource = loadSound('https://tonejs.github.io/audio/berklee/gong_1.mp3');
font = loadFont('https://cdn.glitch.global/3db712b6-c53c-49eb-a8ea-83c7a363871d/Canterbury.ttf?v=1715211442728');
soundSource = loadSound('//assets/beat.mp3');
font = loadFont('//assets/SourceSansPro-Regular.otf');
}
function setup() {
Expand Down
2 changes: 1 addition & 1 deletion src/content/reference/en/p5.sound/p5.PitchShifter.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ example:
let cnv, soundFile, pitchShifter;
function preload() {
soundFile = loadSound('/assets/gtrSample.mp3');
soundFile = loadSound('//assets/beatbox.mp3');
}
function setup() {
Expand Down
6 changes: 3 additions & 3 deletions src/content/reference/en/p5.sound/p5.SoundFile.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: p5.SoundFile
module: p5.sound
submodule: p5.sound
submodule: SoundFile
file: src/SoundFile.js
description: Load and play sound files.
line: 61
line: 60
isConstructor: true
example:
- |-
Expand All @@ -16,7 +16,7 @@ example:
function preload() {
//replace this sound with something local with rights to distribute
//need to fix local asset loading first though :)
sound = loadSound('https://tonejs.github.io/audio/berklee/gong_1.mp3');
sound = loadSound('//assets/doorbell.mp3');
}
function setup() {
Expand Down
Loading

0 comments on commit c4eea2e

Please sign in to comment.