diff --git a/index.html b/index.html index 2023809..7729dd3 100644 --- a/index.html +++ b/index.html @@ -12,41 +12,41 @@ + + -
- +
+ @@ -54,5 +54,7 @@
+ + diff --git a/media/a_note.mp3 b/media/a_note.mp3 index b658113..b48171c 100644 Binary files a/media/a_note.mp3 and b/media/a_note.mp3 differ diff --git a/media/e_note.mp3 b/media/e_note.mp3 index a9eed15..bcecaea 100644 Binary files a/media/e_note.mp3 and b/media/e_note.mp3 differ diff --git a/media/t_note.mp3 b/media/t_note.mp3 new file mode 100644 index 0000000..a9eed15 Binary files /dev/null and b/media/t_note.mp3 differ diff --git a/noise.css b/noise.css index 5c37256..527e0ec 100644 --- a/noise.css +++ b/noise.css @@ -3,7 +3,7 @@ html { } body { - background-color: black; + background-color: black; } .instrument { diff --git a/noise.js b/noise.js index 1d6dd4b..203a4bb 100644 --- a/noise.js +++ b/noise.js @@ -1,3 +1,24 @@ +var playNote = function(note){ + + note.load(); + note.play(); +}; + $(document).ready( function() { - // your code here -}); + //for clicking + $('.note').on("click",function() { + var sound = $(this).html(); + var note = $('#' + sound + 'Audio')[0]; + // notes.load(); + // notes.play(); + playNote(note); + }); + +//for keyboard functionality + $('body').keydown(function(event) { + var noise = $('#' + event.key + 'Audio')[0]; + // noise.load(); + // noise.play(); + playNote(noise); + }); + });