Skip to content

Commit 7d72e70

Browse files
committed
documentation of setPitch method
1 parent 440ed59 commit 7d72e70

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/soundfile.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,14 @@ class SoundFile {
886886
}
887887

888888
// TO DO: document this
889+
/**
890+
* Set the pitch rate of a sound file. Will change the pitch and the speed also.
891+
*
892+
* @method setPitch
893+
* @for p5.SoundFile
894+
* @param {Number} pitchRate Set the pitch rate.
895+
* Values ​​less than zero are also accepted.
896+
*/
889897
setPitch(num) {
890898
var newPlaybackRate = midiToFreq(num) / midiToFreq(60);
891899
this.rate(newPlaybackRate);

0 commit comments

Comments
 (0)