Arduino to discern musical notes?

I want to be able to determine when a specific melody is played on a xylophone. Is this something that can be done? For instance, if notes C-C-G-G-A-A-G are played in order (Twinkle Twinkle Little Star) it can discern the correct notes?

Can you attach sensors to the xylophone keys?

TheMemberFormerlyKnownAsAWOL:
Can you attach sensors to the xylophone keys?

Maybe, but would prefer a solution not doing so.

If you do a search on "Arduino guitar tuner" you'll find quite a few projects which claim to be able to distinguish notes. I don't know how genuinely accurate they are and I suspect they're quite slow to pick up the correct note but they might have some helpful ideas.

Do you need this to work in genuine real time i.e. is there something you are going to be doing with notes as they are played? Or do you just want to know after the event what notes were played? What range of notes must it cover?

Steve

slipstick:
If you do a search on "Arduino guitar tuner" you'll find quite a few projects which claim to be able to distinguish notes. I don't know how genuinely accurate they are and I suspect they're quite slow to pick up the correct note but they might have some helpful ideas.

Do you need this to work in genuine real time i.e. is there something you are going to be doing with notes as they are played? Or do you just want to know after the event what notes were played? What range of notes must it cover?

Steve

Specifically, it'll be an escape room puzzle. Egyptian mummy's tomb theme. Player finds an old xylophone hidden/buried. It has hieroglyphic symbols on the keys. There's a locked door, next to it is a little stand where the xylophone will obviously fit. Right above this, a short series of the same hieroglyphic symbols. Player plays them and it produces the classic "snake charmer" riff of twelve notes. If they play these, it unlocks the door.

Goertzel library perhaps? But you may have to do something about the rapidly changing envelope of such a signal.

I would try some kind of piezoelectric vibration sensor attached under each bar so you don't actually detect the frequency/notes.