Learning mechanical vibrations through computation