Package com.meapsoft

Examples of com.meapsoft.FeatChunk


    {
      double currTime = 0.0;
      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);
View Full Code Here


    public EDLFile compose()
    {
        // initial chunk - pick it at random:
        //int randIdx = (int)Math.floor(featFile.chunks.size()*Math.random());
        // start with the first chunk
        FeatChunk currChunk = (FeatChunk)featFile.chunks.get(0);
       
        dist.setTarget(currChunk);
       
        // maintain a set of chunks sorted using dist from targetChunk
        MinHeap chunks = new MinHeap(dist);
View Full Code Here

    // iterate through all the chunks that the segmenter found
    while (c.hasNext())
    {
      // your current features chunk
      FeatChunk ch = (FeatChunk) c.next();

      // make a new EDL chunk from the current features chunk
      EDLChunk original = new EDLChunk(ch, currTime);
      // we're going to make one more chunk for the backwards part
      EDLChunk backwards = new EDLChunk(ch, currTime + ch.length);
View Full Code Here

    }

    for (int i = 0; i < numChunks; i++)
    {
      // first we fill in a cVI
      FeatChunk fC = (FeatChunk) ((FeatChunk) featFile.chunks
          .get(i)).clone();
      ChunkVisInfo cVI = new ChunkVisInfo(fC.srcFile, fC.startTime,
          fC.length, -1);
      cVI.addFeature(fC.getFeatures());
      events.add(cVI);

      if (eDLFile != null)
      {
        int numEDLChunks = eDLFile.chunks.size();
View Full Code Here

    for (int i = 0; i < events.size(); i++)
    {
      ChunkVisInfo cVI = (ChunkVisInfo) events.get(i);
      if (cVI.selected)
      {
        FeatChunk c = new FeatChunk(cVI.srcFile, cVI.startTime,
            cVI.length, null);
        c.addFeature(cVI.getFeatures());
        c.comment = cVI.comment;
        v.add(c);
      }
    }
View Full Code Here

      e.printStackTrace();
      System.exit(-1);
    }
   
    Vector chunks = (Vector)featFile.chunks;
    FeatChunk fC = (FeatChunk)chunks.elementAt(0);
    if (!fC.containsFeature("AvgChroma"))
    {
      System.out.println("ChromaTopComposer requires the AvgChroma feature!");
      return;
    }
  }
View Full Code Here

      System.exit(-1);
    }
   
    //System.out.println("chunks.size(): " + featFile.chunks.size());
    //Vector chunks = (Vector)featFile.chunks;
    FeatChunk fC = (FeatChunk) featFile.chunks.get(0);
    if (!fC.containsFeature("AvgChroma"))
    {
      System.out.println("ChromaTopComposer requires the AvgChroma feature!");
      return;
    }
   
View Full Code Here

      return null;
    }
   
    for (int chunkNum = 0; chunkNum < numChunks; chunkNum++)
    {
      FeatChunk fC = (FeatChunk)chunks.elementAt(chunkNum);
   
      double chromas[] = fC.getFeatureByName("AvgChroma");
      double chromasSort[] = fC.getFeatureByName("AvgChroma");
      Arrays.sort(chromasSort);
      int firstChroma = -1;
      int secondChroma = -1;
      int thirdChroma = -1;

      //System.out.println("chromasSort[0]: " + chromasSort[0] + " chromasSort[11]: " + chromasSort[11]);
      for (int i = 0; i < 12; i++)
      {
        if (chromasSort[11] == chromas[i])
        {
          firstChroma = i;
          //System.out.println("fC: " + i + " value: " + chromas[i]);
        }
        if (chromasSort[10] == chromas[i])
        {
          secondChroma = i;
          //System.out.println("sC: " + i + " value: " + chromas[i]);
        }
        if (chromasSort[9] == chromas[i])
        {
          thirdChroma = i;
          //System.out.println("tC: " + i + " value: " + chromas[i]);
        }
      }
     
      try
      {
        out.write("WAVETABLE(" + fC.startTime + ", " + fC.length +
            ", " + chromasSort[11] * 20000 + " * ampenv, " +
            (6.0 + (firstChroma * 0.01)) + ", 0.5, waveform)\n");
        out.write("WAVETABLE(" + fC.startTime + ", " + fC.length +
            ", " + chromasSort[10] * 15000 + " * ampenv, " +
            (6.0 + (secondChroma * 0.01)) + ", 0.25, waveform)\n");
        out.write("WAVETABLE(" + fC.startTime + ", " + fC.length +
            ", " + chromasSort[9] * 15000 + " * ampenv, " +
            (6.0 + (thirdChroma * 0.01)) + ", 0.75, waveform)\n");
        out.write("WAVETABLE(" + fC.startTime + ", " + fC.length +
            ", " + chromasSort[11] * 20000 + " * ampenv, " +
            (8.0 + (firstChroma * 0.01)) + ", 0.5, waveform)\n");
        out.write("WAVETABLE(" + fC.startTime + ", " + fC.length +
            ", " + chromasSort[10] * 15000 + " * ampenv, " +
            (8.0 + (secondChroma * 0.01)) + ", 0.75, waveform)\n");
        out.write("WAVETABLE(" + fC.startTime + ", " + fC.length +
            ", " + chromasSort[9] * 15000 + " * ampenv, " +
            (8.0 + (thirdChroma * 0.01)) + ", 0.25, waveform)\n");
      }
      catch (Exception e)
      {
       
      }
     
      for (int i = 0; i < 12; i++)
      {
        if (firstChroma != i &&
            secondChroma != i &&
            thirdChroma != i)
        {
          chromas[i] = 0.0;
        }
         
      }
     
      fC.clearFeatures();
      fC.addFeature(chromas);
     
      outFile.chunks.add(fC);
    }
   

View Full Code Here

    public EDLFile compose()
    {
        // initial chunk - pick it at random:
        //int randIdx = (int)Math.floor(featFile.chunks.size()*Math.random());
        // start with the first chunk
        FeatChunk currChunk = (FeatChunk)featFile.chunks.get(0);
       
        dist.setTarget(currChunk);
       
        // maintain a set of chunks sorted using dist from targetChunk
        MinHeap chunks = new MinHeap(dist);
        chunks.addAll(featFile.chunks);
       
        NumberFormat fmt = NumberFormat.getInstance();
        fmt.setMaximumFractionDigits(3);
       
        double currTime = 0;
        while(chunks.size() > 0)
        {
            dist.setTarget(currChunk);
            chunks.rebuildHeap();
           
            currChunk = (FeatChunk)chunks.deleteMin();
           
            // turn currChunk into an EDL chunk
            EDLChunk nc = new EDLChunk(currChunk, currTime);

            if(debug)
            {
                nc.comment = "    # feats = ";
                double[] feat = currChunk.getFeatures(featdim);
                for(int x = 0; x < feat.length-1; x++)
                    nc.comment += fmt.format(feat[x]) + ", ";
                nc.comment += fmt.format(feat[feat.length-1]);
            }

View Full Code Here

    Iterator c = featFile.chunks.iterator();
    double currTime = 0;

    while (c.hasNext())
    {
      FeatChunk ch = (FeatChunk) c.next();

      EDLChunk nc = new EDLChunk(ch, currTime);
      // hard-coded parameters of blip
      EDLChunk blip = new EDLChunk(blipWav, 0, 0.1, currTime);
View Full Code Here

TOP

Related Classes of com.meapsoft.FeatChunk

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.