Skip to content

Commit ba1662b

Browse files
committed
spacing_mistake_clear
1 parent 2bbf0e8 commit ba1662b

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

src/soundfile.js

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -899,35 +899,39 @@ class SoundFile {
899899
* will increase as a result.
900900
* @example
901901
* <div><code>
902-
* let sound,sRate, midiVal;
902+
* let sound, sRate, midiVal;
903903
* let midiNotes = [60, 64, 67, 72];
904904
* let noteIndex = 0;
905+
*
905906
* function preload() {
906907
* sound = loadSound('assets/beat.mp3');
907-
* }
908+
* }
908909
*
909910
* function setup() {
910-
* let cnv = createCanvas(100, 100);
911-
* cnv.mousePressed(startSound);
912-
* }
911+
* let cnv = createCanvas(100, 100);
912+
* cnv.mousePressed(startSound);
913+
* }
914+
*
913915
* function draw() {
914-
* background(220);
915-
* sRate = sound.rate();
916-
* text('tap to play', 10, 20);
917-
* if (midiVal) {
918-
* text('MIDI: ' + midiVal, 10, 40);
919-
* text('Rate: ' + sRate, 10, 60);
920-
* }
916+
* background(220);
917+
* sRate = sound.rate();
918+
* text('tap to play', 10, 20);
919+
* if (midiVal) {
920+
* text('MIDI: ' + midiVal, 10, 40);
921+
* text('Rate: ' + sRate, 10, 60);
921922
* }
923+
* }
924+
*
922925
* function startSound() {
923-
* if (sound.isPlaying()){
924-
* sound.stop();
925-
* }
926-
* sound.play();
927-
* midiVal = midiNotes[noteIndex % midiNotes.length];
928-
* sound.setPitch(midiVal);
929-
* noteIndex++;
926+
* if (sound.isPlaying()) {
927+
* sound.stop();
930928
* }
929+
* sound.play();
930+
* midiVal = midiNotes[noteIndex % midiNotes.length];
931+
* sound.setPitch(midiVal);
932+
*
933+
* noteIndex++;
934+
* }
931935
* </code></div>
932936
*/
933937
setPitch(num) {

0 commit comments

Comments
 (0)