In this paper we investigate a biological framework to generate and adapt a motion pattern so that can be energy efficient. In fact, the motion pattern in legged animals and human emerges among interaction between a central pattern generator neural network called CPG and the musculoskeletal system. Here, we model this neuro - musculoskeletal system by means of a leg - like mechanical system called stretchable pendulum, and an adaptive frequency nonlinear oscillator as a CPG unit. The stretchable pendulum is a simple oscillating mass - spring mechanism that interacts with the ground during its oscillations, and this interaction begins with a collision. Interaction with the ground causes the model to involve in two dynamic phases that are switched to each other through transition events. This hybrid model is very similar to models have been proposed for the legged locomotion mechanisms. Then, it will be simulated in coupling with an adaptive frequency Hopf oscillator as a controller placed in feedback loop. The simulation results reveal that this scheme is able to excite the mechanical system in an energy efficient pattern by way of exploiting resonance phenomenon. Also, adaptation of the system against the environmental changes is examined and it is seen that the controller is able to find the resonant mode after the changes were made.