Package org.jfugue

Examples of org.jfugue.Player.play()


        // 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


    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++;
View Full Code Here

      if (follow) {
        paraSoundString += processString(theLine);
        para += theLine;
        if (theLine.length() < 2) {
          System.out.println(para);
          player.play("T" + (int) tempo + " " + paraSoundString);
          paraSoundString = "";
          para = "";
        }
      }
    }
View Full Code Here

      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);
    }
  }

  /**
   * Turn the input string into a sound string that can be played by jFugue
View Full Code Here

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

    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

      @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
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.