Mode selection in pulsating stars