How to improve automatic beam groups when frequently using \time

Groups of beamed notes can be made by setting the subdivideBeams property. However, if you have \time-statements inside your score, you'll need to set the beatLength again after each \time-statement (that has a denominator that is not 8). This happens because the \time-statements reset the beatLength-value to the denominator of the time signature. So, if you have many meter-changes, you can use the following function named \timenb #X #Y instead of \time X/Y.