Go Down

Topic: What are Pitch & Tone in music/microcontroller (Read 156 times) previous topic - next topic

Vindhyachal_Takniki

I have to play music through microcontroller. There is requriement to change the pitch & tone of the music. Actually there are two push button for this, one for music & other for tone.
I dont know what these two buttons actually do? What there function actually?

DVDdoug

Pitch is the perception of frequency (high notes & low notes).   A kitty cat makes a high-pitched sound and tiger makes a low-pitch.


Tone can mean a lot of different things but it's probably the tembre/character of the sound...  That's the overtones & harmonics that make a piano sound different from a trumpet when they are playing the same note, or it's what makes two different singers sound different when singing the same song and the same notes.   

Grumpy_Mike

Quote
I have to play music through microcontroller.
Is this some sort of assignment?

Quote
. Actually there are two push button for this, one for music & other for tone
So are you saying you have a micro controller wired up with two buttons but you don't know how they are wired up? Is this micro controller an Arduino? If so what sort?

Are you wanting to change the pitch of the music without changing the speed?
Where is this music coming from? An internal SD card or an audio source?

Vindhyachal_Takniki

I have asked question in wrong way. Let me rephrase it.

I have a musical instrument from a company in front of me, I have to make my own. Inside it, it has some ic, but all part numbers are erased.
Its a musical instrument which play stored music basically. It has option to control: volume, pitch & tone of music.

I have no such experiene in playing music. I want to know where to begin with??

Grumpy_Mike

Quote
I want to know where to begin
I would have thought with posting a picture of your instrument.
Then say what you want to do.
Do you want to change that instrument in some way?
Do you want to make something like that instrument using an Arduino?

Vindhyachal_Takniki

1. I want to make instrument as it is
2. Either with arduino or any other mcu from AVR.


Paul Stoffregen

Let me see if I understand... you want us to assist you to make a copy (knock off) of some company's product.

You also want us to spend our time guessing what that product is, what it does, how it sounds, etc?  Better we waste our time, than you invest the effort to share photos & video...

DVDdoug

#7
Aug 23, 2016, 05:00 pm Last Edit: Aug 23, 2016, 05:03 pm by DVDdoug
The Arduino can make some simple sounds...  Square waves & rectangle waves.   It's going to sound electronic/synthesized and it's difficult to play more than one note at a time.    Try out the tone() function and the Play melody to see what kind of sounds you can get.

Or, if you don't know what a square wave sounds like, download Audacity.  It can generate "tones" (square waves, sine waves, etc.) that you can play on your computer.    And if you want to take the time, you can look-up the frequencies for various notes and generate a sequence of tones to play a melody.

It's going to take additional hardware to make anything that sounds like a real musical instrument.   And since the Arduino doesn't have a DAC, there's no way to get dynamics or generate ADSR.

(I don't know how modern keyboards are made...  I haven't seen a schematic or block diagram for a keyboard...  I assume it looks a lot like a computer with the addition of keys and maybe a DSP chip.)

Quote
1. I want to make instrument as it is
Is is broken or are you trying to duplicate it?

Either way, it's probably going to be impossible since you don't know what's inside and you don't know what waveforms are produced.   

You may be able to make something similar, but it's going to sound different.
 

And of course, it's impossible for us to help you because we have no idea what you've got.


CrossRoads

You can make a simple organ like keyboard. '1284P is good for that, 13 'keys' and 13 simultaneous outputs.
Youtube demo, output playing on self-powered computer speakers from a retired desktop.
https://www.youtube.com/watch?v=4c8idXN4Pg0
Arduino topic on it.
http://forum.arduino.cc/index.php?topic=179761.0
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

With a little filtering, you can make the simple square waves have other timbres as well.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Paul Stoffregen

#10
Aug 23, 2016, 09:59 pm Last Edit: Aug 23, 2016, 10:00 pm by Paul Stoffregen
It's going to take additional hardware to make anything that sounds like a real musical instrument.   And since the Arduino doesn't have a DAC, there's no way to get dynamics or generate ADSR.
Indeed options for quality sound are quite limited on Arduino Uno.

But if you step up to more powerful ARM-based boards which also have real DAC pins, so much more becomes possible.  I recently launched a kickstarter for a couple much more powerful boards.  In the video on that page, I did a demo where a sketch synthesizes 6 guitar strings.  It's all CD quality 44.1kHz 16 bit sound.  This uses only 7.7% of the CPU power of that board to simulate all 6 and mix and play them to the DAC pin.  The sound demo begins about 1 minute into the video, if you'd like to skip past the talk about the products.

Grumpy_Mike

Quote
I recently launched a kickstarter for a couple much more powerful boards. 
Looks cool, just backed it.

Paul Stoffregen

Thanks  :)

If you're planning any more DIY audio books, maybe we could collaborate next year on some DSP material?  180 MHz with the M4's DSP extensions is going to make possible things that have been unimaginable on microcontrollers... like a phase vocoder for real-time pitch shifting!

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy