-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for OGG, updated the version of modernizer that the pro…
…ject uses, got rid of unused SWF files. Signed-off-by: David Hilowitz <dhilowitz@gmail.com>
- Loading branch information
Showing
11 changed files
with
62 additions
and
79 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
TITO | ||
==== | ||
|
||
A musical instrument that uses a bouncing ball gravity model to trigger and manipulate audio samples. Uses: HTML5 Canvas for visuals, Flash for Audio. | ||
A musical instrument that uses a bouncing ball gravity model to trigger and manipulate audio samples. Uses: HTML5 Canvas for visuals, HTML5 for Audio. | ||
|
||
See it in action here: http://www.chromeexperiments.com/detail/tito/ |
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,45 @@ | ||
function JSAudioTagSoundGeneration(numVoices) { | ||
this.numVoices = numVoices; | ||
this.voices = new Array(this.numVoices); | ||
this.lastVoice = -1; | ||
this.format = Modernizr.audio.ogg ? 'ogg' : | ||
Modernizr.audio.mp3 ? 'mp3' : | ||
Modernizr.audio.wav ? 'wav' : | ||
'm4a'; | ||
} | ||
|
||
JSAudioTagSoundGeneration.prototype.init = function init() | ||
{ | ||
for(var voiceIndex = 0; voiceIndex < this.numVoices; voiceIndex++) | ||
{ | ||
this.voices[voiceIndex] = new Audio(); | ||
//this.voices[voiceIndex].autoplay = true; | ||
} | ||
} | ||
|
||
JSAudioTagSoundGeneration.prototype.playNote = function playNote(noteNumber) | ||
{ | ||
if( (this.lastVoice + 1) >= this.numVoices) | ||
this.lastVoice = 0; | ||
else | ||
this.lastVoice++; | ||
|
||
var noteURL = this.getNoteURL(noteNumber); | ||
//d("playNote: " + noteNumber + " on voice " + this.lastVoice + ((noteURL != null) ? " (URL: " + this.getNoteURL(noteNumber) + ")" : "")); | ||
|
||
if(noteURL != null) | ||
{ | ||
this.voices[this.lastVoice].src = "_/snd/" + noteURL; | ||
this.voices[this.lastVoice].play(); | ||
} | ||
} | ||
|
||
JSAudioTagSoundGeneration.prototype.getNoteURL = function getNoteURL(noteNumber) | ||
{ | ||
if(noteNumber >= 48 && noteNumber <= 112) | ||
{ | ||
return "autoharp/" + this.format + "/" + zeroPad(noteNumber, 3) + "." + this.format; | ||
} | ||
return null; | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.