lCtx.setCurrentPhrase(null); // end of phrase, start a new one
lCtx.setCurrentPhraseMeasuresCounter(0);
lCtx.setPreviousLength(0);
// one-or-two-measure rest before the next phrase
ExtendedPhrase pausePhrase = new ExtendedPhrase();
pausePhrase.setTitle("Phrase " + lCtx.getPhrases().size());
pausePhrase.setScale(lCtx.getCurrentScale());
int measures = Chance.test(85) || lCtx.getScoreContext().getScore().getTempo() < 90 ? 1 : 2;
pausePhrase.setMeasures(measures);
for (int i = 0; i < measures; i ++) {
pausePhrase.addRest(new Rest(lCtx.getNormalizedMeasureSize())); //TODO upbeat here as well?
}
lCtx.getPhrases().add(pausePhrase);
lCtx.setTotalMeasures(lCtx.getTotalMeasures() + measures);
lCtx.setUsePreviousMeasureLengths(false);