For many years, the hidden Markov model (HMM) has been one of the most popular tools for analysing sequential data. One frequently used special case is the left-right model, in which the order of the hidden states is known. If knowledge of the duration of a state is available it is not possible to represent it explicitly with an HMM. Methods for modelling duration with HMM’s do exist (Rabiner in Proc. IEEE 77(2):257–286, ), but they come at the price of increased computational complexity. Here we present an efficient and robust algorithm for modelling duration in HMM’s, and this algorithm is successfully used to control autonomous computer actors in a theatrical play.