Package jm.music.data

Examples of jm.music.data.Part


                }
                double endTime = part.getEndTime();

                //if to is shorter then the actual part, make a truncated copy
                if(to < endTime) {
                        Part copy = part.copy(0.0, to);
                        part.empty();
                        part.addPhraseList(copy.getPhraseArray());
                        return;
                } // other wise add cycles of itself to itself

                // go through each whole cycle that needs to be gone through.
                int startPoint = 1;
                double cycleAt = to;
                for(cycleAt = to; (int)(cycleAt/endTime) > 1; cycleAt -= endTime) {
                        Phrase [] phrases = part.getPhraseArray(); //go through phrases
                        for(int i=0; i<phrases.length; i++) {
                                //setStartTime to make it in phase with that cycle
                                phrases[i].setStartTime(phrases[i].getStartTime()+
                                                        startPoint*endTime);
                                part.addPhrase(phrases[i]);
                        }
                        startPoint++;
                }

                //  copy in the remainding stuff in
                double remainder = (to - (startPoint*endTime));

                if( remainder > 0.0) {
                        Part copy = part.copy(0.0, remainder, true, true, false);
                        Phrase [] phrases = copy.getPhraseArray(); //go through phrases
                        for(int i=0; i<phrases.length; i++) {
                                //setStartTime to make it in phase with that cycle
                                phrases[i].setStartTime(phrases[i].getStartTime()+
                                                        startPoint*endTime);
                                part.addPhrase(phrases[i]);
View Full Code Here


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

            return;
        }

        Enumeration enum1 = score.getPartList().elements();
    while(enum1.hasMoreElements()){
      Part nextPart = (Part)enum1.nextElement();
            fadeIn(nextPart, fadeLength);
    }
  }
View Full Code Here

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

                Enumeration enum1 = s.getPartList().elements();
                while(enum1.hasMoreElements()) {
                        Part p = (Part)enum1.nextElement();
                        increaseDynamic(p, amount);
                }
        }
View Full Code Here

            return;
        }
   
        Enumeration enum1 = score.getPartList().elements();
    while(enum1.hasMoreElements()){
      Part nextPart = (Part)enum1.nextElement();
      //make the correction for Parts that don't end at the same time as the Score does
            fadeOut(nextPart, fadeLength, (score.getEndTime() - nextPart.getEndTime()));
    }
  } 
View Full Code Here

            return;
        }

        Enumeration enum1 = score.getPartList().elements();
    while(enum1.hasMoreElements()){
      Part part = (Part) enum1.nextElement();
            compress(part, ratio);
    }
  }
View Full Code Here

    //get the longest end time
    double maxEndTime = 0.0;
        Enumeration enum1 = score.getPartList().elements();
    while(enum1.hasMoreElements()){
      Part part = (Part) enum1.nextElement();
      if (maxEndTime < part.getEndTime()) maxEndTime = part.getEndTime();
    }
   
        for(int i = 0; i < score.getPartList().size(); i++){
            Part p = (Part) score.getPartList().elementAt(i);
      int numbOfPhrases = p.getPhraseList().size();
            for (int t=0;t< (times - 1);t++){
        double initialEndTime = maxEndTime*(t+1);
        for(int j=0;j<numbOfPhrases;j++){
          Phrase phr = (Phrase) p.getPhraseList().elementAt(j);
          Phrase phrCopy = phr.copy();
          phrCopy.setStartTime(initialEndTime+phr.getStartTime());
          p.addPhrase(phrCopy);
        }
      }
    }
  }
View Full Code Here

        double endTime = score1.getEndTime();
       
        Enumeration enum1 = score2.getPartList().elements();
        while(enum1.hasMoreElements()) {
            Part currPart = (Part) enum1.nextElement();
            // update start times and program changes
            Enumeration enum2 = currPart.getPhraseList().elements();
            while(enum2.hasMoreElements()) {
                Phrase currPhrase = (Phrase)enum2.nextElement();
                currPhrase.setStartTime(currPhrase.getStartTime() + endTime);
                if (currPhrase.getInstrument() != 250 && currPhrase.getInstrument() != currPart.getInstrument())
                    currPhrase.setInstrument(currPart.getInstrument());
                if (currPhrase.getInstrument() == currPart.getInstrument())
                    currPhrase.setInstrument(Phrase.DEFAULT_INSTRUMENT);
            }
        }

        // add to score1
View Full Code Here

            return;
        }
        // Go through the parts in the new score
        // and merge them one by one
        boolean channelExists = false;
        Part existingPart;
        Part partToMerge;

        int s1Size = score1.size();
        int s2Size = score2.size();
        for (int i=0; i< s2Size; i++) {
            partToMerge = score2.getPart(i);
            // check if its channel exists
            int chan = partToMerge.getChannel();

            for (int j=0; j < s1Size; j++) {
                existingPart = score1.getPart(j);
                if (chan == existingPart.getChannel()) {
                    // transfer phrases
                    int phraseNumb = partToMerge.size();
                    for(int k=0; k< phraseNumb; k++) {
                        existingPart.addPhrase(partToMerge.getPhrase(k));
                    }
                    channelExists = true;
                    j = s1Size; // get out of loop
                }
            }
View Full Code Here

        if (score == null || qValue <= 0.0 || mode == null || key < 0) {
            return;
        }
        Enumeration enum1 = score.getPartList().elements();
    while(enum1.hasMoreElements()){
      Part part = (Part) enum1.nextElement();
            quantize(part, qValue, mode, key);
    }
  }
View Full Code Here

TOP

Related Classes of jm.music.data.Part

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.