  We study linear ordinary differential equations which are analytically
parametrized on Hermitian symmetric spaces and invariant under the action of
symplectic groups. They are generalizations of the classical Lam\'e equation.
Our main result gives a closed relation between such differential equations and
automorphic forms for symplectic groups. Our study is based on techniques
concerning with the monodromy of complex differential equations, the
Baker-Akhiezer functions and algebraic curves attached to rings of differential
operators.
