Exemple #1
0
 public static void midi(Phrase paramPhrase, String paramString) {
   Part localPart = new Part();
   localPart.addPhrase(paramPhrase);
   Score localScore = new Score("Score of " + paramPhrase.getTitle());
   localScore.addPart(localPart);
   midi(localScore, paramString);
 }
Exemple #2
0
 public static void midi(CPhrase paramCPhrase) {
   Part localPart = new Part();
   localPart.addCPhrase(paramCPhrase);
   Score localScore = new Score("Score of " + paramCPhrase.getTitle());
   localScore.addPart(localPart);
   midi(localScore, paramCPhrase.getTitle() + ".mid");
 }
Exemple #3
0
 public static void xml(Phrase paramPhrase) {
   Part localPart = new Part();
   localPart.addPhrase(paramPhrase);
   Score localScore = new Score("Score of " + paramPhrase.getTitle());
   localScore.addPart(localPart);
   xml(localScore, paramPhrase.getTitle() + ".xml");
 }
Exemple #4
0
 public static void au(CPhrase paramCPhrase, Instrument[] paramArrayOfInstrument) {
   Part localPart = new Part();
   localPart.addCPhrase(paramCPhrase);
   Score localScore = new Score("Score of " + paramCPhrase.getTitle());
   localScore.addPart(localPart);
   au(localScore, paramCPhrase.getTitle() + ".au", paramArrayOfInstrument);
 }
Exemple #5
0
  public static void main(String[] args) {
    Phrase phr = new Phrase();

    // create a random walk
    int pitch = 60;
    for (int i = 0; i < 12; i++) {
      Note n = new Note(pitch += (int) (Math.random() * 8 - 4), SQ * (int) (Math.random() * 2 + 1));
      phr.addNote(n);
    }

    // repeat the whole thing three times
    Mod.repeat(phr, 3);

    // see the result at this stage
    View.show(phr);

    // repeat beats 2 - 4 three times
    Mod.repeat(phr, 3, 2.0, 4.0);

    // see the result of this change
    View.show(phr, 50, 50);

    // hear the result
    Part p = new Part();
    Score s = new Score();
    p.addPhrase(phr);
    s.addPart(p);
    s.setTempo(140.0);

    Play.midi(s, false);
    // false so that it doesn't close everything, the view.show() window
    // in particular

    Write.midi(s, "Repeat.mid");
  }
Exemple #6
0
 public static void au(Phrase paramPhrase, String paramString, Instrument paramInstrument) {
   Part localPart = new Part();
   localPart.addPhrase(paramPhrase);
   Score localScore = new Score("Score of " + paramPhrase.getTitle());
   localScore.addPart(localPart);
   Instrument[] arrayOfInstrument = {paramInstrument};
   au(localScore, paramString, arrayOfInstrument);
 }
Exemple #7
0
 /** Convert a SMF into the jMusic data type */
 @SuppressWarnings("rawtypes")
 public static void SMFToScore(Score score, SMFTools smf) {
   Enumeration<Track> en = smf.getTrackList().elements();
   // Go through tracks
   while (en.hasMoreElements()) {
     Part part = new Part();
     Track smfTrack = en.nextElement();
     Vector evtList = smfTrack.getEvtList();
     Vector phrVct = new Vector();
     sortEvents(evtList, phrVct, smf, part);
     for (int i = 0; i < phrVct.size(); i++) {
       part.addPhrase((Phrase) phrVct.elementAt(i));
     }
     score.addPart(part);
     score.clean();
   }
 }
Exemple #8
0
 public static void midi(Part paramPart, String paramString) {
   Score localScore = new Score("Score of " + paramPart.getTitle());
   localScore.addPart(paramPart);
   midi(localScore, paramString);
 }
Exemple #9
0
 public static void xml(Part paramPart) {
   Score localScore = new Score("Score of " + paramPart.getTitle());
   localScore.addPart(paramPart);
   xml(localScore, paramPart.getTitle() + ".xml");
 }
Exemple #10
0
 public static void au(Part paramPart, String paramString, Instrument[] paramArrayOfInstrument) {
   Score localScore = new Score("Score of " + paramPart.getTitle());
   localScore.addPart(paramPart);
   au(localScore, paramString, paramArrayOfInstrument);
 }
Exemple #11
0
 public static void jm(Part paramPart) {
   Score localScore = new Score("Score of " + paramPart.getTitle());
   localScore.addPart(paramPart);
   jm(localScore, paramPart.getTitle() + ".jm");
 }
Exemple #12
0
 public static void midi(Note paramNote, String paramString) {
   Score localScore = new Score("Score of a single note");
   Part localPart = new Part(new Phrase(paramNote));
   localScore.addPart(localPart);
   midi(localScore, paramString);
 }