Skip to content

Commit 2fcb614

Browse files
Added clarification on documentation related to beats and seconds
1 parent 006cfed commit 2fcb614

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

src/soundLoop.js

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,17 @@ define(function (require) {
66

77
/**
88
* SoundLoop
9-
*
9+
* Beats are the periodic and repeating fluctuations heard in the intensity of a sound when two sound waves of very similar frequency interfere with one another.
10+
* Nodes are the locations where no sound is produced as a result of destructive interference.
11+
* Beat pattern is characterized by a wave whose amplitude is changing at a regular rate.
12+
* It oscillates from a zero amplitude to a larger amplitude, back to zero amplitude throughout the pattern.
13+
* This corresponds to a peak on the beat pattern when constructive interference occurs between two sound waves and a loud sound is heard.
1014
* @class p5.SoundLoop
1115
* @constructor
1216
*
13-
* @param {Function} callback this function will be called on each iteration of theloop
14-
* @param {Number|String} [interval] amount of time (if a number) or beats (if a string, following <a href = "https://github.com/Tonejs/Tone.js/wiki/Time">Tone.Time</a> convention) for each iteration of the loop. Defaults to 1 second.
17+
* @param {Function} callback this function will be called on each iteration of the loop
18+
* @param {Number|String} [interval] amount of time (if a number) or beats (if a string, following <a href = "https://github.com/Tonejs/Tone.js/wiki/Time">Tone.Time</a> convention) for each iteration of the loop.
19+
* Time always defaults to 1 second(and never milliseconds) here.
1520
*
1621
* @example
1722
* <div><code>
@@ -86,10 +91,10 @@ define(function (require) {
8691
var timeFromNow = time - p5sound.audiocontext.currentTime;
8792
/**
8893
* Do not initiate the callback if timeFromNow is < 0
89-
* This ususually occurs for a few milliseconds when the page
94+
* This usually occurs for a few milliseconds when the page
9095
* is not fully loaded
9196
*
92-
* The callback should only be called until maxIterations is reached
97+
* The callback should only be called until maxIterations are reached
9398
*/
9499
if (timeFromNow > 0 && self.iterations <= self.maxIterations) {
95100
self.callback(timeFromNow);}
@@ -247,7 +252,10 @@ define(function (require) {
247252
/**
248253
* Getters and Setters, setting any paramter will result in a change in the clock's
249254
* frequency, that will be reflected after the next callback
250-
* beats per minute (defaults to 60)
255+
* Beats per minute or bpm is used to measure the tempo or pace of a piece
256+
* beats per minute (defaults to 60) refers to the rate at which
257+
* the volume is heard to be oscillating from its high to low per minute
258+
* A tempo of 60 bpm here signifies one beat per second and with a higher bpm(say 120) the time changes accordingly(0.5 beats per second and so on)
251259
* @property {Number} bpm
252260
* @for p5.SoundLoop
253261
*/
@@ -268,7 +276,10 @@ define(function (require) {
268276
});
269277

270278
/**
271-
* number of quarter notes in a measure (defaults to 4)
279+
* One note is defined as a completion of 4 beats exactly, which is, 1 full beat = 1/4 * note.
280+
* That is why on looping a two-sound phrase at say x BPM, you get 4 times of x sounds per minute.
281+
* Hence, the number of quarter notes in a measure (defaults to 4)
282+
* meaning that 4 times the intensity of sound varies between its minimum and maximum.
272283
* @property {Number} timeSignature
273284
* @for p5.SoundLoop
274285
*/

0 commit comments

Comments
 (0)