A model of repetitive behaviour illustrated by chickadee calling