Best regards,
I need help to create a melody generator using pic16f1939 microcontroller. To be more precise, I need a code that would do this function.
Thanks everyone.
We will not do your homework for you. What you can expect is support to find a solution in your own way.
Start by telling or showing us what you have achieved so far and where you are stuck.
I have this record in the notes. Would anyone be able to read and digitally record the duration of individual notes and breaks.Or should someone help me with this because I am a music amateur..
If this is school work, you should probably pay attention to your class and ask the professor if you are having a hard time reading the samples. There are a lot of tutorials online that you can check to get more ideas regarding this project.
Looking at the pic you mention, it has only 28k of flash on board: https://www.microchip.com/wwwproducts/en/PIC16F1939
How would you program a melody in the pic?
You would need information on the pitch and duration of the notes to be played.
You will need to find a way to "store" your melody.
I know about that Bertus, butI have no idea how to do it.
Btw I just started working with pic microcontroller.
In fact, I'm also an amateur in programming..
There is at least one library to generate sound snippets (tones) of defined frequency and duration from a pic µc and a discussion on the topic here.
You'll have to translate the notes of the sheet into a set of frequency/duration pairs (e.g. in the form of an array) and loop through them in your program, calling each tone for the specified duration (duration being a function of the Tempo and the Note Value)