Package de.sciss.meloncillo.io

Examples of de.sciss.meloncillo.io.AudioStake$ActionDebugDump


      long              t, tt;
//      BlendSpan            bs;
      // interpLen entspricht 'T' in der Formel (Gesamtzeit), interpOff entspricht 't' (aktueller Zeitpunkt)
      long              start, interpOff;
      long              progress  = 0;
      AudioStake            as;
       
      interpLen   = span.getLength();
      warpedTime  = new float[(int) Math.min( interpLen, 4096 )];
      interpBuf   = new float[2][ warpedTime.length ];

      t_norm      = 1.0 / (interpLen - 1);
      v_start_norm  = (float) (vStart * t_norm);
      dv_norm      = (float) ((vStop - vStart) / 2 * t_norm * t_norm);

//      initFunctionEvaluation();
     
      progressLen      = interpLen*collTrns.size();
     
      try {
        for( int i = 0; i < collTrns.size(); i++ ) {
          trns  = (Transmitter) collTrns.get( i );
          at    = trns.getAudioTrail();

//          bs = at.beginOverwrite( span, bc, edit );
          as = at.alloc( span );

          // XXX has to be called for each trns?
          initFunctionEvaluation();

          for( start = span.getStart(), interpOff = 0; start < span.getStop();
             start += len, interpOff += len ) {
            
            len  = (int) Math.min( 4096, span.getStop() - start );
            t  = interpOff;
            for( int j = 0; j < len; j++, t++ ) {
              tt        = t*t;
              warpedTime[j]   = v_start_norm * t + dv_norm * tt;
//              warpedTime[j]   = (v_start_norm * t + dv_norm * tt) * 1.5f - 0.25f;  // extrap.
            }
            evaluateFunction( warpedTime, interpBuf, len );
            if( bc != null ) {
              at.readFrames( srcBuf, 0, new Span( start, start + len ));
              if( interpOff < bc.getLen() ) {  // EEE getLen?
                bc.blend( interpOff, srcBuf, 0, interpBuf, 0, interpBuf, 0, len );
              }
              if( interpLen - (interpOff + len) < bc.getLen() ) {  // EEE getLen?
                bc.blend( interpOff - (interpLen - bc.getLen()), interpBuf, 0, srcBuf, 0, interpBuf, 0, len );
              }
            }
            as.writeFrames( interpBuf, 0, new Span( start, start + len ));
//            at.continueWrite( bs, interpBuf, 0, len );
            progress += len;
            context.setProgression( (float) progress / (float) progressLen );
          }
          at.editBegin( edit );
View Full Code Here


//    BlendSpan            bs;
    // interpLen entspricht 'T' in der Formel (Gesamtzeit), interpOff entspricht 't' (aktueller Zeitpunkt)
    long              start, interpOff, interpLen, progressLen;
    long              progress  = 0;
//    boolean              success    = false;
    AudioStake            as;

//    if( span.getLength() < 2 ) return DONE;
    if( !initFunctionEvaluation( (Point2D[]) context.getClientArg( "points" ))) return FAILED;

    interpLen    = span.getLength();
    warpedTime    = new float[(int) Math.min( interpLen, 4096 )];
    interpBuf    = new float[2][ warpedTime.length ];
    // '-1' because the last sample shall really equal the end point of the shape
    t_norm      = 1.0 / (interpLen - 1);

    progressLen    = interpLen*collTrns.size();

    try {
      for( i = 0; i < collTrns.size(); i++ ) {
        trns  = (Transmitter) collTrns.get( i );
        at    = trns.getAudioTrail();
        as    = at.alloc( span );
//        bs = at.beginOverwrite( span, bc, edit );
        for( start = span.getStart(), interpOff = 0; start < span.getStop();
           start += len, interpOff += len ) {

          len = (int) Math.min( 4096, span.getStop() - start );
          calcWarpedTime( warpedTime, interpOff * t_norm, t_norm, len );
          evaluateFunction( warpedTime, interpBuf, len );
//          at.continueWrite( bs, interpBuf, 0, len );
          if( bc != null ) {
            at.readFrames( srcBuf, 0, new Span( start, start + len ));
            if( interpOff < bc.getLen() ) {  // EEE getLen?
              bc.blend( interpOff, srcBuf, 0, interpBuf, 0, interpBuf, 0, len );
            }
            if( interpLen - (interpOff + len) < bc.getLen() ) {  // EEE getLen?
              bc.blend( interpOff - (interpLen - bc.getLen()), interpBuf, 0, srcBuf, 0, interpBuf, 0, len );
            }
          }
          as.writeFrames( interpBuf, 0, new Span( start, start + len ));
          progress += len;
          context.setProgression( (float) progress / (float) progressLen );
        }
//        at.finishWrite( bs, edit );
        at.editBegin( edit );
View Full Code Here

      long          progress  = 0;
      double          d1;
      Span          span    = (Span) context.getClientArg( "span" );
//      TrackSpan        ts;
      float          f1, f2;
      AudioStake        as;
      int            chunkLen;
     
      if( span.isEmpty() ) return DONE;
     
      try {
        for( int i = 0; i < num; i++ ) {
          d1    = ((double) i / (double) num - 0.25) * Math.PI * -2;
//          f1    = (float) (0.25 * (2.0 + Math.cos( d1 )));
//          f2    = (float) (0.25 * (2.0 + Math.sin( d1 )));
          f1    = (float) (0.5 * Math.cos( d1 ));
          f2    = (float) (0.5 * Math.sin( d1 ));
          for( int j = 0; j < 4096; j++ ) {
            buf[0][j] = f1;
            buf[1][j] = f2;
          }
          trns  = (Transmitter) collNewTrns.get( i );
          at    = trns.getAudioTrail();
//          ts    = at.beginInsert( span, edit );
          as    = at.alloc( span );
          for( long framesWritten = 0, frames = span.getLength(); framesWritten < frames; ) {
            chunkLen = (int) Math.min( 4096, frames - framesWritten );
//            at.continueWrite( ts, buf, 0, j );
            as.writeFrames( buf, 0, new Span( span.start + framesWritten, span.start + framesWritten + chunkLen ));
            framesWritten += chunkLen;
          }
//          stakes.add( as );
          at.editBegin( edit );
          try {
View Full Code Here

TOP

Related Classes of de.sciss.meloncillo.io.AudioStake$ActionDebugDump

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.