forked from processing/p5.js-sound
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of ssh://github.com/mrjoshida/p5.js-sound
* 'master' of ssh://github.com/mrjoshida/p5.js-sound: rebuild lib dispose of ConvolverNode before resetting buffer (processing#321) rebuild lib with reference example fix processing#320 move loadSound call to preload prevent crashes during completion of callbacks on disposed SoundFiles 0.3.9 add soundfile.save example add `save()` and `getBlob()` methods to SoundFile. Move .wav conversion to helpers.js (processing#315) Added saveSoundToBlob() to soundRecorder.js Document properties of AudioIn update master limiter - sharp knee monosynth: remove unused _isOn monosynth: remove unused filter, patch velocity Missed this fragment during the renaming corrected formatting by replacing tabs with four spaces fixed issue: processing/p5.js-sound#297
- Loading branch information
Showing
13 changed files
with
548 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<head> | ||
<script language="javascript" type="text/javascript" src="../../lib/p5.js"></script> | ||
|
||
<script language="javascript" type="text/javascript" src="../../lib/addons/p5.dom.js"></script> | ||
|
||
<script language="javascript" type="text/javascript" src="../../lib/p5.sound.js"></script> | ||
|
||
<script language="javascript" type="text/javascript" src="sketch.js"></script> | ||
|
||
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
function setup() { | ||
background(0); | ||
noStroke(); | ||
fill(255); | ||
textAlign(CENTER); | ||
text('click to play', width/2, height/2); | ||
|
||
mySound = loadSound('../files/beat.mp3'); | ||
|
||
// schedule calls to changeText | ||
var firstCueId = mySound.addCue(0.50, changeText, "hello" ); | ||
mySound.addCue(1.00, changeText, "p5" ); | ||
var thirdCueId = mySound.addCue(1.50, changeText, "what" ); | ||
mySound.addCue(2.00, changeText, "do" ); | ||
mySound.addCue(2.50, changeText, "you" ); | ||
mySound.addCue(3.00, changeText, "want" ); | ||
mySound.addCue(4.00, changeText, "to" ); | ||
mySound.addCue(5.00, changeText, "make" ); | ||
mySound.addCue(6.00, changeText, "?" ); | ||
|
||
//remove the first cue | ||
mySound.removeCue(firstCueId); | ||
|
||
//remove the third cue | ||
mySound.removeCue(thirdCueId); | ||
} | ||
|
||
function changeText(val) { | ||
background(0); | ||
text(val, width/2, height/2); | ||
} | ||
|
||
function mouseClicked() { | ||
if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { | ||
if (mySound.isPlaying() ) { | ||
mySound.stop(); | ||
} else { | ||
mySound.play(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.