Package jm.music.data

Examples of jm.music.data.Part


    }

    private void getWidthAndParts() {
        Enumeration enum1 = score.getPartList().elements();
        while (enum1.hasMoreElements()) {
            Part part = (Part) enum1.nextElement();
            maxParts++;
            Enumeration enum2 = part.getPhraseList().elements();
            while (enum2.hasMoreElements()) {
                Phrase phrase = (Phrase) enum2.nextElement();
                Enumeration enum3 = phrase.getNoteList().elements();
                maxWidth = (int) (phrase.getStartTime() * beatWidth);
                while (enum3.hasMoreElements()) {
View Full Code Here


        //  this.setSize((int)(score.getEndTime()* beatWidth), myHeight);
        //} else {
        //  this.setSize(newWidth, myHeight);
        //}
        while (enum1.hasMoreElements()) {
            Part part = (Part) enum1.nextElement();
            //Make each part a different colour
            g.setColor(theColors[i % 10]);
            i++;

            Enumeration enum2 = part.getPhraseList().elements();
            while (enum2.hasMoreElements()) {
                Phrase phrase = (Phrase) enum2.nextElement();
                Enumeration enum3 = phrase.getNoteList().elements();
                double oldStartTime = phrase.getStartTime();

View Full Code Here

        // add phrase to the score as a new part
        if (phr != null) {
            currentChannel++;
            if (currentChannel > 15) currentChannel = scoreChannels;
            Part p = new Part("Sketch Part", 0, currentChannel);
            p.addPhrase(phr);
            score.addPart(p);
        }
    }
View Full Code Here

        //set score tempo
        double score_ratio = 60.0 / score.getTempo();
        int partCounter = 0;
        /* Enumerate through all parts */
        while (enum1.hasMoreElements()) {
            Part part = (Part) enum1.nextElement();

            //set part tempo
            double part_ratio = score_ratio;
            if (part.getTempo() > 0.0)
                part_ratio = 60.0 / part.getTempo();

      /* Get the instrument being used for this part */
            if (part.getInstrument() != NO_INSTRUMENT) {
                try {
                    inst.push(instList[part.getInstrument()]);
                } catch (ArrayIndexOutOfBoundsException npe) {
                    System.out.println("jMusic Audio warning: Can't find the instrument number " +
                            part.getInstrument() + " that you have specified for " +
                            "the part named " + part.getTitle() + ".");
                }
            }
            System.out.println("Part " + partCounter++ + " '" + part.getTitle() + "'. ");

      /* Enumerate through all phrases */
            Enumeration enum2 = part.getPhraseList().elements();
            int phraseCounter = 0;
            while (enum2.hasMoreElements()) {
                Phrase phr = (Phrase) enum2.nextElement();
                //get phrase tempo
                double phrase_ratio = part_ratio;
View Full Code Here

    }

    public Notate(Phrase phrase, int locX, int locY) {
        super("CPN: " + phrase.getTitle());
        clearZoom();
        this.score = new Score(new Part(phrase));
        locationX = locX;
        locationY = locY;
        score = new Score(new Part(phrase));
        init();
    }
View Full Code Here

                new Double(getProperty(OTHER_NOTES_TOTAL_DUR))
                        .doubleValue()
        );

        Score s = new Score();
        Part p = new Part();
        s.addPart(p);
        p.addPhrase(phrase);
    }
View Full Code Here

     *
     * @param Phrase
     * @param String fileName
     */
    public static void midi(Phrase phr, String fileName) {
        Part p = new Part();
        midi(p, fileName);
        phr = p.getPhrase(0);
    }
View Full Code Here

     * @param String fileName
     */
    public static void midi(CPhrase cphr, String fileName) {
        Score s = new Score();
        midi(s, fileName);
        Part p = new Part();
        p = s.getPart(0);
        for (int i = 0; i < p.size(); i++) {
            cphr.addPhrase(p.getPhrase(i));
        }
    }
View Full Code Here

     * extend the HelperGUI class.
     */
    protected Score compose() {
        // Simple example composition
        Phrase phrase = new Phrase();
        Score s = new Score(new Part(phrase));
        //for(int i = 0; i < 8; i++) {
        Note n = new Note(48 + (int) (Math.random() * variableA), 0.5 + variableB * 0.25);
        phrase.addNote(n);
        //}

View Full Code Here

     * @param String fileName
     */
    public static void jm(Part p, String fileName) {
        if (p == null) {
            System.err.println("jMusic Read.jm error: The part is not initialised! I'm doing it for you.");
            p = new Part();
        }
        p.empty();
        Score s = new Score();
        jm(s, fileName);
        p.addPhraseList(s.getPart(0).getPhraseArray());
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.