Detect a simple musical tune to activate a servo

Hi,
I want to build a puzzle box for my son’s graduation. I have far more woodworking skills than electronics skills but I see the Arduino as a nice simple tool to use as a clever locking mechanism for part of the puzzle box. He has a musical background so I would like one of the locks to require the playing of a particular tune. A very simple way to do it would be to make a single octave piano keyboard with Arduino buttons, play the correct sound for each with the tone() function and write a simple program to keep track of the sequence, actuating the servo to unlock the box if it is correct.

But then I got a better idea. Surely with all of the technology available today, that would allow one to play a tune on an instrument (piano, xylophone, whistling, whatever) into a microphone and the Arduino determine if it is the correct tune or not to unlock the box. Although I have a background in Fourier transforms in other contexts and in coding, I have no inclination to try to create such a thing, but I am hoping there is a simple solution. I saw an Instructable from 2012 that does such a thing but most of the associated files are no longer available and it was pre-Arduino / Raspberry Pi so involved building a complicated circuit board. https://www.instructables.com/id/A-Box-with-a-Music-Lock/

I have seen other tutorials on general sound detection (like a clap to activate something) but not musical note recognition. E.g. Interfacing Sound Sensor with Arduino - Add Sound Detection to Arduino - Add Sound Detection to Arduino

Any ideas?

Thanks!
Steve

Acmartina:
But then I got a better idea. Surely with all of the technology available today, that would allow one to play a tune on an instrument (piano, xylophone, whistling, whatever) into a microphone and the Arduino determine if it is the correct tune or not to unlock the box.

OK, the first idea was good Arduino, but now you have talked yourself out of it. :astonished:

Pi Zero perhaps ...