Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

AVR Music...

Status
Not open for further replies.

lord loh.

Member
Well This is not related to electronics at all but, I still hope to get some advice from some people having music as their hobby....

I am trying to programme an AVR to play a misic... ATmega8535

The timer0 is set for time duration count while the 16 bit timer1 is meant for frequency generation. The output shll be available at the OC1A pin.

Now I know nothing about music... An internet search session educated me about notes " C D E F G A B C1 " having frequencies between 130.8Hz and 246.9Hz

Then there is supposed to be an overlaping scale called C# scale that is " C# D# F F# Ab Bb C C#1 " there seem to be n such scales depending on wich frequency you choose to start with. So there also seems to be no hard and fast rule to select frequencies but the interval must have some specific ratio...

Then I saw at some other site that tempo is the number of pulses per quarter note and is generally 120 pulses. So my 130.8Hz full note shall last for 3.6s and this also implies that the duration of the full note shall vary with frequency.... Sounds strange... I am a music rookie :eek:

Please help me out....

My questions are:
  • To play music properly, how many different frequencies should I be able to get my AVR generating?
  • How long should a full note last? and do I have to make provisions to play half, quarter, eighth, sixteenth and thirtysecond notes?
  • Can I choose any arbitrary frequency to start with? and maintain correct intervals?
  • Some site mentioned about semitones... I do not figure that out...

Thank you.
 
You might have a look at , I know it's PIC and not AVR, but the code is in C, and it explains the music reasonably well.

I've run it on a PIC (actually on various PIC's, from 8 pin upwards), and it works great!.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top