Pages: [1] 2   Go Down
Author Topic: A Mini Piano  (Read 1887 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Sr. Member
****
Karma: 2
Posts: 337
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey guys, I plan to make a mini piano with maybe like 8 buttons for 'Do, Re, Mi, Fa, So, La, Ti, Do'

So what I want is just basic first. When I press a button then the speaker will give 'Do', then another button give me 'Re'

I know it is quite simple to do, just I dont have any ideas on tones in arduino.

Hope I can get some helps here.

Thank you in advance smiley
Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 98
Posts: 3569
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You need to look at the Tone example. From there you can see the it needs a certain library that has all the tones in it. Now once you understand how that example works, you can modify it to output a tone if a certain "pin" goes HIGH and go silent if the pin is LOW.

Also if your familiar with a normal piano, Do to Do is an octave, and there are also different scales that you can program into the code too, if you want to get fancy.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Offline Offline
Sr. Member
****
Karma: 2
Posts: 337
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You need to look at the Tone example. From there you can see the it needs a certain library that has all the tones in it. Now once you understand how that example works, you can modify it to output a tone if a certain "pin" goes HIGH and go silent if the pin is LOW.

Also if your familiar with a normal piano, Do to Do is an octave, and there are also different scales that you can program into the code too, if you want to get fancy.

What do you mean by the bolded part ? Somehow confuse.

Thank you
Logged

Offline Offline
Edison Member
*
Karma: 33
Posts: 1432
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You are the one that started with Do, Re, Mi...
He means that from Do (C) to Do(C) is an octave on the piano keyboard.
Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 337
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay, you mean program the Do for different frequency ? I do not have music background. So sometimes I do not understand what you tell me.

But I will learn.

Thank you
Logged

Offline Offline
Edison Member
*
Karma: 33
Posts: 1432
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Start here:
http://arduino.cc/en/Tutorial/Tone
Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 337
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am sucks in music frequency stuff. Can anyone tell me the basic one and their frequency ? How many buttons needed ?

Thanks !
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 55
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Take an oscilloscope. Stick microphone in scope. Hit C on piano, measure frequency. Then hit next note and so on up to octave above. Program Arduino to emit said frequency in accord to button pressed.
Logged

Chicago
Offline Offline
Sr. Member
****
Karma: 5
Posts: 456
With every answer comes more questions.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Take an oscilloscope. Stick microphone in scope. Hit C on piano, measure frequency. Then hit next note and so on up to octave above. Program Arduino to emit said frequency in accord to button pressed.

Right, because it sounds like he probably has an oscilloscope just laying around.....?

Or....google "music note frequency" and find something like this -
http://www.audiology.org/news/interviews/documents/chasinconversionchart.pdf

Then, follow the tone and button tutorials to figure out the rest. 
Logged

South England
Offline Offline
Full Member
***
Karma: 3
Posts: 205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You're going to need at least 13 buttons if you want to play anything interesting smiley-wink
Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 337
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What are the 13 buttons and frequency ?

Thanks
Logged

South England
Offline Offline
Full Member
***
Karma: 3
Posts: 205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.phy.mtu.edu/~suits/notefreqs.html

Remember, there are 13 keys in each "octave". The sharps and flats allow you to play in any key without re-tuning.

That table should do it! Although I don't think you can use float values in tone(), so if you care about having it properly in-tune, you may need another approach. If not, just bang in the closest value rounded up or down to suit, and hope for the best.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 55
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Take an oscilloscope. Stick microphone in scope. Hit C on piano, measure frequency. Then hit next note and so on up to octave above. Program Arduino to emit said frequency in accord to button pressed.

Right, because it sounds like he probably has an oscilloscope just laying around.....?

Or....google "music note frequency" and find something like this -
http://www.audiology.org/news/interviews/documents/chasinconversionchart.pdf

Then, follow the tone and button tutorials to figure out the rest. 

Yes but we want this guy to think for himself don't we? If he wants help I think he should present his idea in its entirety so that we can add suggestions. What is this little piano to look like? What are its features to be? How big is it intended to be? Who's it for, us or a specialised niche?  All this needs to be revealed so that we can all co-operate. We need to give him a reason to reveal his vision, but if we just hand out easy fixes on tap he will disapeer like all the others and we'll be left with yet another inconclusive thread.
Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 337
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey all, this is my plan :

I plan to do a mini wireless piano where the speaker is wireless. And it is able to play the Happy Birthday Songs. Besides, it is the best if it can play some others songs/melody. I made this for my friend during her birthday as gift.

Hope it is clear.

So, any suggestion on how many and what keys should be included to make it somehow impressive piano that can play quite a number of melody ?

Thank you
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 55
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hopefully at this stage you are drawing artist impressions on how the finished article will appear.  Presumably you want the unit so that the user can enter in and hopefully edit any now song that comes to mind via controls on the unit? You would like it capable of connecting to an external speaker / amp set up? That bit is probably the easiest - if you start by using a 1/4" jack socket and consider the nature of how it will transmit wirelessly as an upgrade. Will the unit have provision to plug in headphones to use as a standalone?
Logged

Pages: [1] 2   Go Up
Jump to: