Nahm's equations and modular forms