piano
piano copied to clipboard
¿Can I touch key from any function or instruction?
I would to ask if I can touch key programatically.
Uhmmmm
Maybe you can create a triggers to simulate click on keys...
i am thinking to make chords programatically, do you think that is possible??
I think yes.
But I don't have imagined it when I've created this project.
By the momento firing click does not work:
$($("li.key")[1]).click();
I suppose that to fire the event that plays the sound will be enough
The correct approach is
$("li.key:nth-child(2) > .black-key").trigger('click');
or $("li.key:nth-child(2) > .white-key").trigger('click');
that sounds on you machine???
Not, it's weird.
I need to test again later.
Hello from France :) You think about making chords, like this ? http://www.pianochord.org/
I would be very interested to. And I would be interested to contribute to it. The other day, I just made a simple keyboard on my Codepen, but it isn't as good as yours.
Hi @aureliet. This is an old project (since 2013), but I want to update it.
I like any suggestion to improve piano and I am open to PR's accepts 😹
Thanks!
Hello @LFeh !
My code can be better, I think, but now we can have the chords.
Can I propose the app to a music school? They won't pay me for it. Maybe one free piano lesson but that's all. They would be interested to use it on their website for their students.
Edit : in the index.html : Now we have data-number on the spans. From this, we can calculate the chords. And we have two selects, to get the different chords variations.
in the _general.js : The js I added to make chords
And... we will have to add notes, because from the A# to the end, we don't have enough...
For the problem I mentionned before, problem solved . Just change theses cases :
case "Add2" :
note2 = note1+2;
note3 = note1+4;
note4 = note1+7;
break;
case "Addm2" :
note2 = note1+1;
note3 = note1+4;
note4 = note1+7;
break;
case "Addm3" :
note2 = note1+3;
note3 = note1+4;
note4 = note1+7;
break;
Hey @developez, check if it works now?