Skip to content

Commit 83e46b4

Browse files
authored
Merge pull request #702 from Nitesh639/getPictch_doc
getPatch() documentation
2 parents 4bbe4ef + 64b2b49 commit 83e46b4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/soundfile.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,16 @@ class SoundFile {
902902
var newPlaybackRate = midiToFreq(num) / midiToFreq(60);
903903
this.rate(newPlaybackRate);
904904
}
905+
906+
/**
907+
* Returns the current pitch of a sound file as a MIDI note.
908+
*
909+
* @method getPitch
910+
* @for p5.SoundFile
911+
* @return {Number} Current pitch of the SoundFile. The default note is assumed to
912+
* be 60 (middle C).
913+
*
914+
*/
905915
getPitch() {
906916
var freqValue = this.rate() * midiToFreq(60);
907917
return freqToMidi(freqValue);

0 commit comments

Comments
 (0)