Package jm.music.data

Examples of jm.music.data.Score


     * @param String fileName
     */
    public static void jm(Score s, String fileName) {
        if (s == null) {
            System.err.println("jMusic Read.jm error: The score is not initialised! I'm doing it for you.");
            s = new Score();
        }
        s.empty();
        try {
            System.out.println("--------------------- Reading .jm File ---------------------");
            InputStream is = new FileInputStream(fileName);
View Full Code Here


        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

        for (int i = 0; i < savePhrase.size(); ++i) {
            phrase.removeNote(0);
        }
        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

        if (cphr == null) {
            System.err.println("jMusic Read.jm error: The CPhrase is not initialised! I'm doing it for you.");
            cphr = new CPhrase();
        }
        cphr.empty();
        Score s = new Score();
        jm(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

     * @param String fileName
     */
    public static void xml(Score s, String fileName) {
        if (s == null) {
            System.err.println("jMusic Read.xml error: The score is not initialised! I'm doing it for you.");
            s = new Score();
        }
        s.empty();
        try {
            System.out.println("--------------------- Reading .xml File ---------------------");
            BufferedReader br = new BufferedReader(new FileReader(fileName));
View Full Code Here

        if (p == null) {
            System.err.println("jMusic Read.xml error: The part is not initialised! I'm doing it for you.");
            p = new Part();
        }
        p.empty();
        Score s = new Score();
        xml(s, fileName);
        p.addPhraseList(s.getPart(0).getPhraseArray());
    }
View Full Code Here

        if (cphr == null) {
            System.err.println("jMusic Read.xml error: The CPhrase is not initialised! I'm doing it for you.");
            cphr = new CPhrase();
        }
        cphr.empty();
        Score s = new Score();
        xml(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

    /**
     * A basic constructor that opens an empty histogram frame.
     */
    public HistogramFrame() {
        this(new Score(), 0);
    }
View Full Code Here

    public void openMIDIFile() {
        FileDialog fd = new FileDialog(new Frame(), "Select a MIDI file to display.", FileDialog.LOAD);
        fd.show();
        String fileName = fd.getFile();
        if (fileName != null) {
            Score score = new Score();
            jm.util.Read.midi(score, fd.getDirectory() + fileName);
            this.score = score;
            histo.setScore(score);
            this.changeDataType(PITCH);
        }
View Full Code Here

    public void openXMLFile() {
        FileDialog fd = new FileDialog(new Frame(), "Select a jMusic XML file to display.", FileDialog.LOAD);
        fd.show();
        String fileName = fd.getFile();
        if (fileName != null) {
            Score score = new Score();
            jm.util.Read.xml(score, fd.getDirectory() + fileName);
            this.score = score;
            histo.setScore(score);
            this.changeDataType(PITCH);
        }
View Full Code Here

TOP

Related Classes of jm.music.data.Score

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.