Package com.music.MainPartGenerator

Examples of com.music.MainPartGenerator.MainPartContext


     */
    public static class WaveMelodyGenerator {

        private static void playMelody(SourceDataLine line, Double[] scaleFrequencies) {
            int position;
            MainPartContext lCtx = new MainPartContext();
            lCtx.setDirectionUp(true);
            ScoreContext ctx = new ScoreContext();
            double[] melody = new double[30];
            double[] lengths = new double[30];
            for (int i = 0; i < 30; i++) {
                position = getNextNotePitchIndex(ctx, lCtx, scaleFrequencies);
View Full Code Here


        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);
View Full Code Here

TOP

Related Classes of com.music.MainPartGenerator.MainPartContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.