In this paper, we introduce a curvilinear coordinate transformation to study the bifurcation of periodic solutions from a 2-degree-of-freedom Hamiltonian system, when it is perturbed in \({\textbf{R}}^{m+4}\) , where m represents any positive integer. The extended Melnikov function is obtained by constructing a Poincaré map on the curvilinear coordinate frame of the trajectory of the unperturbed system. Then the criteria for bifurcation of periodic solutions of these Hamiltonian systems under isochronous and non-isochronous conditions are obtained. As for its application, we study the number of periodic solutions of a composite piezoelectric cantilever rectangular plate system whose averaged equation can be transformed into a \((2+4)\) -dimensional dynamical system. Furthermore, under the two resonance conditions of 1:1 and 1:2, we obtain the periodic solution numbers of this system with the variation of parametric excitation coefficient \(p_1.\)