Package jm.music.data

Examples of jm.music.data.Score


                "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;
            update();
        }
    }
View Full Code Here


                "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;
            update();
        }
    }
View Full Code Here

        addActionListener(new ActionListener() {
                              public void actionPerformed(ActionEvent evt) {
                                  load.show();

                                  Score score = Read.midiOrJmWithAWTMessaging(load.getDirectory(),
                                          load.getFile(),
                                          owner);
                                  if (score == null) {
                                      return;
                                  }
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

    /**
     * Dialog to import a MIDI file
     */
    public void openMidi() {
        Score s = new Score();
        FileDialog loadMidi = new FileDialog(this, "Select a MIDI file.", FileDialog.LOAD);
        loadMidi.setDirectory(lastDirectory);
        loadMidi.setFile(lastFileName);
        loadMidi.show();
        String fileName = loadMidi.getFile();
View Full Code Here

        FileDialog loadjm = new FileDialog(this, "Select a jm score file.", FileDialog.LOAD);
        loadjm.setDirectory(lastDirectory);
        loadjm.show();
        String fileName = loadjm.getFile();
        if (fileName != null) {
            Score s = new Score();
            lastDirectory = loadjm.getDirectory();
            Read.jm(s, lastDirectory + fileName);
            setNewScore(s);
        }
    }
View Full Code Here

        FileDialog loadjmxml = new FileDialog(this, "Select a jMusic XML score file.", FileDialog.LOAD);
        loadjmxml.setDirectory(lastDirectory);
        loadjmxml.show();
        String fileName = loadjmxml.getFile();
        if (fileName != null) {
            Score s = new Score();
            lastDirectory = loadjmxml.getDirectory();
            Read.xml(s, lastDirectory + fileName);
            setNewScore(s);
        }
    }
View Full Code Here

    public Phrase readMidiPhrase() {
        FileDialog loadMidi = new FileDialog(this, "Select a MIDI file.", FileDialog.LOAD);
        loadMidi.show();
        String fileName = loadMidi.getFile();
        Phrase phr = new Phrase(0.0);
        Score scr = new Score();
        if (fileName != null) {
            Read.midi(scr, loadMidi.getDirectory() + fileName);
        }
        scr.clean();
        if (scr.size() > 0 && scr.getPart(0).size() > 0) phr = scr.getPart(0).getPhrase(0);
        //System.out.println("Size = " + phr.size());
        return phr;
    }
View Full Code Here

        double beats = phraseArray[0].getNumerator();
        double endTime = score.getEndTime();
        int numbOfCompleteBars = (int) (endTime / beats);
        double startOflastBar = beats * numbOfCompleteBars;
        if (startOflastBar == endTime) startOflastBar -= beats;
        Score oneBar = score.copy(startOflastBar, endTime);

        for (int i = 0; i < oneBar.size(); i++) {
            oneBar.getPart(i).getPhrase(0).setStartTime(0.0);
        }
        return oneBar;
    }
View Full Code Here

                phrase,
                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

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.