ctx.setScale(Scale.MINOR);
ctx.setKeyNote(5);
ctx.setNoteLengthCoefficient(1);
double normalizedMeasureSize = 1d * ctx.getMetre()[0] * 4 / ctx.getMetre()[1];
ctx.setNormalizedMeasureSize(normalizedMeasureSize);
MainPartContext lCtx = generator.initLocalContext(score, ctx);
lCtx.setPitches(Arrays.asList(60, 80, 80));
ExtendedPhrase p = new ExtendedPhrase();
p.setBaseVelocity(40);
p.setScale(ctx.getScale());
mainPart.add(p);
lCtx.setCurrentPhrase(p);
for (Note note : melody) {
p.addNote(note);
}
List<Note> modified = new ArrayList<>(Arrays.asList(melody));
generator.varyBaseStructure(lCtx, modified);