Quadrupedal animals move through their environments with unmatched agility and grace. An important part of this is the ability to choose between different gaits in order to travel optimally at a certain speed or to robustly deal with unanticipated perturbations. In this paper, we present a control framework for a quadrupedal robot that is capable of locomoting using several gaits. We demonstrate the flexibility of the algorithm by performing experiments on StarlETH, a recently-developed quadrupedal robot. We implement controllers for a static walk, a walking trot, and a running trot, and show that smooth transitions between them can be performed. Using this control strategy, StarlETH is able to trot unassisted in 3D space with speeds of up to 0.7m/s, it can dynamically navigate over unperceived 5-cm high obstacles and it can recover from significant external pushes.