Package org.jfugue

Examples of org.jfugue.Player


        }

        // Create a player, and play the music!
        try {
            Pattern pattern = Pattern.loadPattern(new File(inFilename));
            Player player = new Player();
            player.saveMidi(pattern, new File(outFilename));
            player.play(pattern);
            player.close();
        } catch (IOException e)
        {
            e.printStackTrace();
        }
       
View Full Code Here


        {
            printUsage();
            System.exit(0);
        }
       
        Player player = new Player();
        Pattern pattern = null;
        try {
            pattern = player.loadMidi(new File(args[1]));
            pattern.savePattern(new File(args[2]));
        } catch (IOException e) {
            e.printStackTrace();
        } catch (InvalidMidiDataException e) {
            e.printStackTrace();
View Full Code Here

    String outFilename = inFilename + ".mid";

    List<String> lines = Files.readAllLines(FileSystems.getDefault().getPath(inFilename),
        StandardCharsets.UTF_8);
    StringBuilder inBuilder = new StringBuilder();
    Player player = new Player();
    player.play("T" + (int) tempo + " I[" + instrument + "] ");
    String paraSoundString = "";
    String para = "";
    int lineCount = 0;
    for (String line : lines) {
      lineCount++;
      String theLine = line.replace("\r", "\n") + "\n";
      inBuilder.append(theLine);
      if (follow) {
        paraSoundString += processString(theLine);
        para += theLine;
        if (theLine.length() < 2) {
          System.out.println(para);
          player.play("T" + (int) tempo + " " + paraSoundString);
          paraSoundString = "";
          para = "";
        }
      }
    }
    System.out.println();
    String input = inBuilder.toString();
    // input = "It was the best of times, it was the worst of times";
    // input =
    // "It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair, we had everything before us, we had nothing before us, we were all going direct to heaven, we were all going direct the other way - in short, the period was so far like the present period, that some of its noisiest authorities insisted on its being received, for good or for evil, in the superlative degree of comparison only.";
    // input =
    // "The quality of implementation specifications concern two properties, accuracy of the returned result and monotonicity of the method";
    // input =
    // "In certain service environments, particularly those where the business environment is dynamic and where clients interact with the organisation on a regular basis, we have found a grasp of Systems Thinking is invaluable.";
    // input =
    // "The Sixth Crusade started in 1228 as an attempt to regain Jerusalem";
    // input =
    // "Although Baden-W�rttemberg is lacking natural resources,[2] the state is among the most prosperous states in Germany";
    // input =
    // "If you want to print this guide, it is recommended that you print in Landscape mode";
    // input =
    // "Effective content marketing holds people�s attention. It gives you a distinctive brand, loyal fans and increased sales. You don�t need a big budget to succeed, which is why good content marketing is the single best way to beat bigger competitors online";
    // input =
    // "The municipality was created on 14 March 1997, succeeding the sub-provincial city administration that was part of Sichuan Province";
    if (!follow) {
      String ss = "T" + (int) tempo + " I[" + instrument + "] " + processString(input);
      System.out.println(input);
      player = new Player();
      File file = new File(outFilename);
      player.saveMidi(ss, file);
      player.play(ss);
    }
  }
View Full Code Here

    Thread hilo = new Thread() {
      @Override
      public void run() {
        Pattern pattern = getRhythmPattern();
        pattern.repeat(times);
        Player player = new Player();
        player.play(pattern);       
      }
    };
    hilo.start();
  }
View Full Code Here

      final int tempo) {
    final String instrumentID = getInstrumentRealName(instrument);
    Thread hilo = new Thread() {
      @Override
      public void run() {
        Player player = new Player();
        player.play("T" + tempo + " I[" + instrumentID + "] " + sounds);
        System.out.println("Fin de reproducción de " + instrumentID);
      }
    };
    hilo.start();
  }
View Full Code Here

    Thread bateria = new Thread() {
      @Override
      public void run() {
        Pattern pattern = final_rhythm.getPattern();
        pattern.repeat(3);
        Player player = new Player();
        player.play(pattern);
        System.out.println("Fin de reproducción de ritmo");
      }
    };
    bateria.start();
  }
View Full Code Here

TOP

Related Classes of org.jfugue.Player

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.