Program the arduino to play a sound file??

Ok, so I am really new to this stuff, but I am a student, and we have a project to do after doing some basics (lighting up LEDs, using switches, LCD screens etc.) So for my project, I wanted to create a simple instrument of some sort. So I was wondering, is there some way I could record individual notes, save them as an MP3/WAV/WMA or whatever to my computer, and then play them through either my computer or a piezo speaker/buzzer by using the arduino? My idea is using if statements, and going something like
if(LDR1 < 400){
file1.playNote();
}

So it would be like using your fingers to play the notes with light resistors. But honestly, I’m not sure what I’m doing at all. I want to learn, but I’m just struggling with this sort of stuff. Thanks for any help! :slight_smile:

The tone() function lets you play a note. There are specific frequencies for each note.

Playing wav files requires a wave shield. AdaFruit has them.