Skip to content

Esther Ng Keyboard #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion noise.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
$(document).ready( function() {
// your code here

$('.instrument').on('click', 'button', function(event) {
var classString = $(this).attr("class");
var note = classString.charAt(5);
playIt(note);
});

$('body').keydown(function(event) {
if (event.key.match(/[a-gA-G]/)){
playIt(event.key.toLowerCase());
}
});

});


var playIt = function(note) {
var sound = $("#" + note + 'Audio');
sound[0].load();
sound[0].play();
};

// var embeds = ($('#audio_embeds').children("audio"));
// var clips = embeds.map(function() {
// return $(this).attr("id");
// });
// console.log(clips);
50 changes: 50 additions & 0 deletions noiseComments.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
$(document).ready( function() {
// your code here
// $('#cAudio').play();
// console.log(cAudio);
// console.log(cNote);
// var playIt = playAudio();
// cNote.click(playIt(cAudio));
// var cAudio = ($('#cAudio'));
// var cNote = $('.c');
// cNote.click(playAudio(cAudio));

var embeds = ($('#audio_embeds').children("audio"));
// var clips = embeds.map(function() {
// return $(this).attr("id");
// });
console.log(embeds[0]);
// console.log(clips[0].includes("c"));

// $('.instrument').on('click', 'button', function(event) {
// var noteArray = $(this).attr("class");
// var note = noteArray[5];
// play
// // var sound = $("#" + note + 'Audio');
// // sound[0].play();
// });
//
// $('body').keydown(function(event) {
// var note = event.key;
// playIt(note);
// // var sound = $("#" + note + 'Audio');
// // sound[0].play();
// });

});
//
// var playIt = function(note) {
// var sound = $("#" + note + 'Audio');
// sound[0].play();
// };

// function playAudio(clip) {
// clip.play();
// }

// function playAudio() {
// var playThis = function(audio) {
// audio.play();
// };
// return playThis;
// }