Package jm.music.data

Examples of jm.music.data.Score.addPart()


                        .doubleValue()
        );

        Score s = new Score();
        Part p = new Part();
        s.addPart(p);
        p.addPhrase(phrase);
    }

    public boolean isTrebleStave() {
        return getProperty(STAVE_TYPE).equals(TREBLE_STAVE);
View Full Code Here


        }
        try {
            JmMidiPlayer midiPlayer = new JmMidiPlayer();
            Score sc = new Score();
            Part p = new Part();
            sc.addPart(p);
            p.addPhrase(phrase);
            Write.midi(sc, midiPlayer);
            midiPlayer.play();
            midiPlayer.close();
        } catch (MidiUnavailableException ex) {
View Full Code Here

            }
        }
        Element[] children = element.getChildren();
        for (int i = 0; i < children.length; i++) {
            if (XMLStyles.isValidPartTag(children[i].getName())) {
                returnScore.addPart(elementToPart(children[i]));
            }
        }
        return returnScore;
    }
View Full Code Here

     * @param exit Hold program open for the duration of playback, then close ready to exit? true or false.
     */
    public static void midi(Note n, boolean exit) {
        //System.out.println("in midi(Note n, boolean exit)");
        Score s = new Score("One note score", 60);
        s.addPart(new Part(new Phrase(n)));
        midi(s, exit);
    }

    /**
     * Playback the jMusic score JavaSound MIDI
View Full Code Here

    public static void midi(Phrase phr, boolean exit) {
        double tempo = 60;
        if (phr.getTempo() != Phrase.DEFAULT_TEMPO) tempo = phr.getTempo();
        Score s = new Score(phr.getTitle() + " score", tempo);
        if (phr.getTempo() != Phrase.DEFAULT_TEMPO) s.setTempo(phr.getTempo());
        s.addPart(new Part(phr));
        midi(s, exit);
    }

    /**
     * Playback the jMusic score JavaSound MIDI
View Full Code Here

    public static void midi(Part p, boolean exit) {
        double tempo = 60;
        if (p.getTempo() != Part.DEFAULT_TEMPO) tempo = p.getTempo();
        Score s = new Score(p.getTitle() + " score", tempo);
        if (p.getTempo() != Part.DEFAULT_TEMPO) s.setTempo(p.getTempo());
        s.addPart(p);
        midi(s, exit);
    }

    /**
     * Playback the jMusic score JavaSound MIDI.
View Full Code Here

     * @param n     The note to be played. See midiCycle(Score s)
     * @param index The midiCycle id to be used - default is 0.
     */
    public static void midiCycle(Note n, int index) {
        Score s = new Score("One note score");
        s.addPart(new Part(new Phrase(n)));
        midiCycle(s, index);
    }

    /**
     * Repeated playback the jMusic phrase via the JavaSound MIDI synthesizer
View Full Code Here

     * @param phr   The Phrase to be played. See midiCycle(Score s)
     * @param index The midiCycle id to be used - default is 0.
     */
    public static void midiCycle(Phrase phr, int index) {
        Score s = new Score(phr.getTitle() + " score");
        s.addPart(new Part(phr));
        midiCycle(s, index);
    }

    /**
     * Repeated playback the jMusic part via the JavaSound MIDI synthesizer
View Full Code Here

     * @param part  The Part to be played. See midiCycle(Score s)
     * @param index The midiCycle id to be used - default is 0.
     */
    public static void midiCycle(Part part, int index) {
        Score s = new Score(part.getTitle() + " score");
        s.addPart(part);
        midiCycle(s, index);
    }

    /**
     * Continually repeat playback of a Score object (i.e., loop playback).
View Full Code Here

            }
        }
        Element[] children = element.getChildren();
        for (int i = 0; i < children.length; i++) {
            if (XMLStyles.isValidPartTag(children[i].getName())) {
                returnScore.addPart(elementToPart(children[i]));
            }
        }
        return returnScore;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.