Package jm.midi

Examples of jm.midi.SMF


            }

            /** Attempt to read file */
            try {
                score.setTitle(filename);
                SMF smf = new SMF();
                if (directory == null) {
                    InputStream is = new FileInputStream(filename);
                    smf.read(is);
                    jm.midi.MidiParser.SMFToScore(score, smf);
                } else {
                    InputStream is = new FileInputStream(directory + filename);
                    smf.read(is);
                    jm.midi.MidiParser.SMFToScore(score, smf);
                }
            } catch (IOException e1) {
                message = e1.getMessage();
                if (message == null) {
View Full Code Here


     * @param Score
     * @param OutputStream outputStream
     */
    public static void midi(Score scr, OutputStream outputStream) {
        //Score s = adjustTempo(scr);
        SMF smf = new SMF();
        try {
            smf.clearTracks();
            jm.midi.MidiParser.scoreToSMF(scr, smf);
            smf.write(outputStream);
        } catch (IOException e) {
            System.err.println(e);
        }
    }
View Full Code Here

     * @param Score
     * @param String filename
     */
    public static void midi(Score scr, String fileName) {
        //Score s = adjustTempo(scr);
        SMF smf = new SMF();
        try {
            double time1 = System.currentTimeMillis();
            System.out.println("----------------------------- Writing MIDI File ------------------------------");
            smf.clearTracks();
            jm.midi.MidiParser.scoreToSMF(scr, smf);
            OutputStream os = new FileOutputStream(fileName);
            smf.write(os);
            double time2 = System.currentTimeMillis();
            System.out.println("MIDI file '" + fileName + "' written from score '" +
                    scr.getTitle() + "' in " + ((time2 - time1) / 1000) + " seconds.");
            System.out.println("------------------------------------------------------------------------------");
        } catch (IOException e) {
View Full Code Here

        if (s == null) {
            System.err.println("jMusic Read.midi error: The score is not initialised! I'm doing it for you.");
            s = new Score();
        }
        s.empty();
        SMF smf = new SMF();
        smf.setVerbose(true);
        try {
            System.out.println("--------------------- Reading MIDI File ---------------------");
            InputStream is = new FileInputStream(fileName);
            smf.read(is);
            jm.midi.MidiParser.SMFToScore(s, smf);
            System.out.println("MIDI file '" + fileName + "' read into score '" + s.getTitle() + "' Tempo = " + s.getTempo());
            System.out.println("-------------------------------------------------------------");
        } catch (IOException e) {
            System.err.println(e);
View Full Code Here

        Score score = null;
        String message = null;

        /** Attempt to read file */
        try {
            SMF smf = new SMF();
            score = new Score(fileName);
            InputStream is = new FileInputStream(directoryName + fileName);
            smf.read(is);
            jm.midi.MidiParser.SMFToScore(score, smf);
        } catch (IOException e1) {
            message = e1.getMessage();
            if (message == null) {
                message = "Unknown IO Exception";
View Full Code Here

        if (s == null) {
                System.err.println("jMusic Read.midi error: The score is not initialised! I'm doing it for you.");
                s = new Score();
        }
        s.empty();
        SMF smf = new SMF();
        smf.setVerbose(true);
        try{
                System.out.println("--------------------- Reading MIDI File ---------------------");
                InputStream is = new FileInputStream(fileName);
                smf.read(is);
                jm.midi.MidiParser.SMFToScore(s,smf);
                System.out.println("MIDI file '"+fileName+"' read into score '" +s.getTitle()+"' Tempo = " + s.getTempo());
                System.out.println("-------------------------------------------------------------");
        }catch(IOException e){
                System.err.println(e);
View Full Code Here

            }
   
            /** Attempt to read file */
            try {
                score.setTitle(filename);
    SMF smf = new SMF();
                if (directory == null) {
       InputStream is = new FileInputStream(filename);
                    smf.read(is);
      jm.midi.MidiParser.SMFToScore(score,smf);
                } else {
       InputStream is = new FileInputStream(directory+filename);
                    smf.read(is);
       jm.midi.MidiParser.SMFToScore(score,smf);
                }
            } catch (IOException e1) {
                message = e1.getMessage();
                if (message == null) {
View Full Code Here

     * @param Score
     * @param OutputStream outputStream
     */
    public static void midi(Score scr, OutputStream outputStream) {       
        //Score s = adjustTempo(scr);
        SMF smf = new SMF();
  try{
    smf.clearTracks();
    jm.midi.MidiParser.scoreToSMF(scr,smf);
            smf.write(outputStream);
        } catch(IOException e) {
      System.err.println(e);
    }
    }
View Full Code Here

    * @param Score
    * @param String filename
    */
    public static void midi(Score scr, String fileName) {       
        //Score s = adjustTempo(scr);
        SMF smf = new SMF();
    try{
                    double time1 = System.currentTimeMillis();   
                    System.out.println("----------------------------- Writing MIDI File ------------------------------");
      smf.clearTracks();
      jm.midi.MidiParser.scoreToSMF(scr,smf);
      OutputStream os = new FileOutputStream(fileName);
      smf.write(os);
      double time2 = System.currentTimeMillis();   
      System.out.println("MIDI file '"+fileName+"' written from score '" +
                            scr.getTitle()+"' in "+ ((time2-time1)/1000)+ " seconds.");
      System.out.println("------------------------------------------------------------------------------");
    }catch(IOException e){
View Full Code Here

        Score score = null;
        String message = null;

        /** Attempt to read file */
        try {
      SMF smf = new SMF();
            score = new Score (fileName);
      InputStream is = new FileInputStream(directoryName + fileName);
            smf.read(is);       
      jm.midi.MidiParser.SMFToScore(score,smf);
        } catch (IOException e1) {
            message = e1.getMessage ();
            if (message == null) {
                message = "Unknown IO Exception";
View Full Code Here

TOP

Related Classes of jm.midi.SMF

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.