Conception of a recorder

Hi everyone !

I'm novice in Arduino code ... And I need your help for a project.
My problem is this one : I have to design a system to record a melody with 10 notes. The system takes a rectangular signal as input, records it and outputs a melody close to the original signal. I need to add a button to start recording the 10 notes of 1 second each, and another button to start playback (PWM signals generated by the Arduino).
I don't understand how to make this in code with Arduino.

Thank you !

Yours is NOT a COVID related post !

If English is not your first language then there are other areas for you.

Language problem ?
Try a language closer to your native language:

If English IS your first language you need to consider where you post.

Could you take a few moments to Learn How To Use The Forum.
It will help you get the best out of the forum in the future.
Other general help and troubleshooting advice can be found here.