Package jm.music.data

Examples of jm.music.data.Part


    public static void main(String[] args) {

        //BELLS, CRYSTAL, ATMOSPHERE, DROPS, STAR_THEME, SOUNDEFFECTS, BIRD, HELICOPTER, APPLAUSE, GUNSHOT, FRET_NOISE, TOM, SOUNDTRACK

        Score score = new Score();
        score.addPart(new Part(Instruments.CLARINET));
        Phrase phrase = new Phrase();
        score.getPart(0).addPhrase(phrase);

//        addChord(new int[] {60, 63, 65}, 1d, 90, phrase, null, true);
        for (int i = 50; i < 70; i++) {
View Full Code Here


        Score score = new Score();
        Read.midi(score, "C:\\workspace\\music\\analysis\\midi\\jarre\\EQUINOX3.MID");
        for (Part part : score.getPartArray()) {
            System.out.println(part.getTitle() + " : " + part.getInstrument());
        }
        Part part = score.getPart(1);

        System.out.println(part.getInstrument());
        part.setTempo(160);
        int previousPitch = 0;
        int prePreviousPitch = 0;
        System.out.println(score.getTimeSignature());
        Multiset<Integer> uniqueIntervals = HashMultiset.create();
        int directionChanges = 0;
        int directionRetentions = 0;

        LinkedList<Double> noteLengths = new LinkedList<>();
        for (Note note : part.getPhrase(0).getNoteArray()) {
            System.out.println(note.getPitch());
            if (!note.isRest()) {
                if (prePreviousPitch != 0) {
                    int previousDiff = previousPitch - prePreviousPitch;
                    int diff = note.getPitch() - previousPitch;
View Full Code Here

                new Note(JMC.D5, JMC.EIGHTH_NOTE), new Note(JMC.C5, JMC.EIGHTH_NOTE),
                new Note(JMC.A4, JMC.EIGHTH_NOTE) };

        MainPartGenerator generator = new MainPartGenerator();
        Score score = new Score();
        Part mainPart = new Part("Main", 1);
        score.addPart(mainPart);
        ScoreContext ctx = new ScoreContext();
        ctx.setMetre(new int[] {3, 8});
        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));
View Full Code Here

TOP

Related Classes of jm.music.data.Part

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.