Skip to content
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

¿Can I touch key from any function or instruction? #14

Open
developez opened this issue Dec 20, 2017 · 12 comments
Open

¿Can I touch key from any function or instruction? #14

developez opened this issue Dec 20, 2017 · 12 comments

Comments

@developez
Copy link

I would to ask if I can touch key programatically.

@felipefialho
Copy link
Owner

felipefialho commented Dec 20, 2017

Uhmmmm

Maybe you can create a triggers to simulate click on keys...

@developez
Copy link
Author

developez commented Dec 20, 2017

i am thinking to make chords programatically, do you think that is possible??

@felipefialho
Copy link
Owner

I think yes.

But I don't have imagined it when I've created this project.

@developez
Copy link
Author

developez commented Dec 20, 2017

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

@felipefialho
Copy link
Owner

felipefialho commented Dec 20, 2017

The correct approach is

$("li.key:nth-child(2) > .black-key").trigger('click'); or $("li.key:nth-child(2) > .white-key").trigger('click');

@developez
Copy link
Author

that sounds on you machine???

@felipefialho
Copy link
Owner

Not, it's weird.

I need to test again later.

@aureliet
Copy link

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.

@felipefialho
Copy link
Owner

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!

@aureliet
Copy link

aureliet commented Jan 24, 2018

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.

dev.zip

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...

@aureliet
Copy link

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;

@felipefialho
Copy link
Owner

Hey @developez, check if it works now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants