Package com.meapsoft

Examples of com.meapsoft.EDLChunk


        Random rand = new Random();
        double currTime = 0;

        // get first chunk from startProbs
        int lastIdx = multinomialSample(rand.nextDouble(), startProbs);
        EDLChunk nc = new EDLChunk((FeatChunk)templateChunks.get(lastIdx),
                                   currTime);
        outFile.chunks.add(nc);
        currTime += nc.length;
        progress.setValue(progress.getValue()+1);

        // use transitionMatrix for the remaining chunks
        for(int x = 1; x < sequenceLength; x++)
        {
            int currIdx = multinomialSample(rand.nextDouble(),
                                            transitionMatrix[lastIdx]);
           
            nc = new EDLChunk((FeatChunk)templateChunks.get(currIdx),
                              currTime);
            outFile.chunks.add(nc);
            currTime += nc.length;
            progress.setValue(progress.getValue()+1);
           
View Full Code Here


      for (int i = numSubChunks - 1; i >= 0; i--)
      {
        //make a new EDL chunk from the current features chunk
        //EDLChunk original = new EDLChunk(ch, currTime);
       
        EDLChunk chunk = new EDLChunk(ch.srcFile,
          localStartTime + (i * length), length, currTime);
       
        //EDLChunk blip = new EDLChunk("data" +
        //  System.getProperty("file.separator") + "blip.wav",
        //  0, 0.1, currTime);
View Full Code Here

    double currentTime = 0.0;

    for (int i = 0; i < selectedChunks.size(); i++)
    {
      EDLChunk oldChunk = (EDLChunk) selectedChunks.elementAt(i);

      EDLChunk newChunk = new EDLChunk(oldChunk.srcFile,
          oldChunk.startTime, oldChunk.length, currentTime);
      newChunk.addFeature(oldChunk.getFeatures());
      eDLOutputFile.chunks.add(newChunk);

      currentTime += oldChunk.length;
    }
View Full Code Here

      if (playFeatChunks)
        oldChunk = (FeatChunk) selectedChunks.elementAt(i);
      else
        oldChunk = (EDLChunk) selectedChunks.elementAt(i);

      EDLChunk newChunk = new EDLChunk(oldChunk.srcFile,
          oldChunk.startTime, oldChunk.length, currentTime);

      // do some fading by default so it doesn't sound so bad
      newChunk.commands.add("fade");

      edl.chunks.add(newChunk);

      if (addBlips)
      {
        EDLChunk blip = new EDLChunk(blipWav, 0, blipDuration,
            currentTime);
        edl.chunks.add(blip);
      }

      currentTime += oldChunk.length;
View Full Code Here

                    match = c;
                }
            }
           
            // turn match chunk into an EDL chunk
            EDLChunk nc = new EDLChunk(match, currChunk.startTime);
            nc.comment = "    # dist = " + fmt.format(mindist);
            outFile.chunks.add(nc);

            progress.setValue(progress.getValue()+1);
        }
View Full Code Here

        while(outChunks.size() > 0)
        {
            FeatChunk match = (FeatChunk)outChunks.remove(0);
           
            // turn match chunk into an EDL chunk
            EDLChunk nc = new EDLChunk(match, currTime);

            if(debug)
            {
        NumberFormat fmt = NumberFormat.getInstance();
        fmt.setMaximumFractionDigits(3);
View Full Code Here

        while(chunks.size() > 0)
        {
            FeatChunk match = (FeatChunk)chunks.remove(0);

            // turn match chunk into an EDL chunk
            EDLChunk nc = new EDLChunk(match, currTime);

            if(debug)
            {
                nc.comment = "    # feats = ";
                double[] feat = match.getFeatures(featdim);
View Full Code Here

      for (int i = 0; i < beatsPerMeasure; i++)
      {
        // System.out.println("i: " + i + " currPosition: " +
        // currPosition);

        EDLChunk newChunk = new EDLChunk(chunks[currPosition], currTime);
        outFile.chunks.add(newChunk);
        currTime += newChunk.length;

        currPosition++;
        currPosition %= beatsPerMeasure;
View Full Code Here

      // if we want chunks that are in the sweetspot
      if (inSweetSpot && insideThreshold)
      {
        // make a new EDL chunk from the current features chunk
        EDLChunk newChunk = new EDLChunk(ch, currTime);
        outFile.chunks.add(newChunk);
        currTime += ch.length;
        // System.out.println("inSweetSpot && insideThreshold, so
        // writing chunk!");
      }
      // if we want chunks that are not in the sweetspot
      else if (!inSweetSpot && !insideThreshold)
      {
        // make a new EDL chunk from the current features chunk
        EDLChunk newChunk = new EDLChunk(ch, currTime);
        outFile.chunks.add(newChunk);
        currTime += ch.length;
        // System.out.println("!inSweetSpot && !insideThreshold, so
        // writing chunk!");
      }
View Full Code Here

            Iterator i = templateChunks.iterator();
            while(i.hasNext())
            {
                FeatChunk currChunk = (FeatChunk)i.next();

                EDLChunk nc = new EDLChunk(
                    (FeatChunk)templateChunks.get(quantizeChunk(currChunk)),
                    currTime);
                outFile.chunks.add(nc);

                currTime += nc.length;
                progress.setValue(progress.getValue()+1);
            }

        }
        else  // quantize featsToQuantize
        {
            Iterator i = featsToQuantize.chunks.iterator();
            while(i.hasNext())
            {
                FeatChunk currChunk = (FeatChunk)i.next();
               
                EDLChunk nc = new EDLChunk(
                    (FeatChunk)templateChunks.get(quantizeChunk(currChunk)),
                    currChunk.startTime);
               
                outFile.chunks.add(nc);
                progress.setValue(progress.getValue()+1);
View Full Code Here

TOP

Related Classes of com.meapsoft.EDLChunk

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.