Package jm.music.data

Examples of jm.music.data.Phrase


            return;
        }
       
        Enumeration enum1 = part.getPhraseList().elements();
        while(enum1.hasMoreElements()){
            Phrase nextPhrase = (Phrase)enum1.nextElement();
            repeat(nextPhrase, times);
        }

        /*
        // Alternate logic: Repeats the phase rather than lengthens the phrase
View Full Code Here


        if (part == null || startLoc >= endLoc || times < 2) {
            return;
        }
        Enumeration enum1 = part.getPhraseList().elements();
    while(enum1.hasMoreElements()){
      Phrase nextPhrase = (Phrase)enum1.nextElement();
            repeat(nextPhrase, times, startLoc, endLoc);
      }
  }
View Full Code Here

   */
   public static void transpose(Part part, final int transposition){
     if (part == null || transposition == 0)return;
     Enumeration enum1 = part.getPhraseList().elements();
     while(enum1.hasMoreElements()){
       Phrase phr = (Phrase) enum1.nextElement();
       transpose(phr,transposition);
     }
   }
View Full Code Here

    int ave;
    int counter = 0;
   
    Enumeration enum1 = part.getPhraseList().elements();
    while(enum1.hasMoreElements()){
      Phrase tempPhrase = (Phrase) enum1.nextElement();
      if (tempPhrase == null) {
        break;
     
      Enumeration enum2 = tempPhrase.getNoteList().elements();
      while(enum2.hasMoreElements()){
        Note note = (Note) enum2.nextElement();
        if(note.getPitch() != REST ) { // reject rests
          curr = note.getDynamic();
          accum += curr;
          counter++;
        }
      }
    }
    ave = (int)(accum / counter);
   
    // compress the sucker
        enum1 = part.getPhraseList().elements();
    while(enum1.hasMoreElements()){
      Phrase tempPhrase = (Phrase) enum1.nextElement();
      if (tempPhrase == null) {
        break;
     
      Enumeration enum2 = tempPhrase.getNoteList().elements();
      while(enum2.hasMoreElements()){
        Note note = (Note) enum2.nextElement();
        System.out.println("note was =" + note.getDynamic());
        curr = (int)(ave + ((note.getDynamic() - ave) * ratio));
        note.setDynamic(curr);
 
View Full Code Here

        //go through the phrases in the new part
        // and add then one by one
            Enumeration enum1 = part2.getPhraseList().elements();
            while(enum1.hasMoreElements()){
                Phrase tempPhrase = ((Phrase) enum1.nextElement()).copy();
                tempPhrase.setStartTime(fromLoc + tempPhrase.getStartTime());
                if (tempPhrase.getInstrument() == part1.getInstrument())
                    tempPhrase.setInstrument(Phrase.DEFAULT_INSTRUMENT);
                part1.addPhrase(tempPhrase);
            }
  }
View Full Code Here

                try{ if(p == null) new NullPointerException();
                } catch(NullPointerException e) {e.toString(); return;}

                Enumeration enum1 = p.getPhraseList().elements();
                while(enum1.hasMoreElements()) {
                        Phrase phr = (Phrase)enum1.nextElement();
                        increaseDynamic(phr, amount);
                }
        }
View Full Code Here

            return;
        }

        Enumeration enum1 = part.getPhraseList().elements();
    while(enum1.hasMoreElements()){
      Phrase nextPhrase = (Phrase)enum1.nextElement();

            //make the correction for phrases that don't start at the same time as the Part does (0.0)
            fadeIn(nextPhrase, fadeLength, nextPhrase.getStartTime());
    }
  }
View Full Code Here

            return;
        }

        Enumeration enum1 = part.getPhraseList().elements();
    while(enum1.hasMoreElements()){
      Phrase nextPhrase = (Phrase)enum1.nextElement();
      //make the correction for phrases that don't start at the same time as the Part does (0.0)
            fadeIn(nextPhrase, fadeLength, (partStartTime + nextPhrase.getStartTime()));
    }
  }
View Full Code Here

            return;
        }
   
        Enumeration enum1 = part.getPhraseList().elements();
    while(enum1.hasMoreElements()){
      Phrase nextPhrase = (Phrase)enum1.nextElement();
      //make the correction for phrases that don't end at the same time as the Part does
            fadeOut(nextPhrase, fadeLength,(part.getEndTime() - nextPhrase.getEndTime()));
    }
  } 
View Full Code Here

            return;
        }
   
        Enumeration enum1 = part.getPhraseList().elements();
    while(enum1.hasMoreElements()){
      Phrase nextPhrase = (Phrase)enum1.nextElement();
      //make the correction for phrases that don't end at the same time as the Part does
            fadeOut(nextPhrase, fadeLength,(partEndTime + part.getEndTime() - nextPhrase.getEndTime()));
    }
  } 
View Full Code Here

TOP

Related Classes of jm.music.data.Phrase

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.