예제 #1
0
// frame callback
void module_process_frame(void) {

  calc_frame();

  // we could shift to fract16 at a cost of only 1b resolution

  /*
  slew32_calc(cvSlew[cvChan]);
  if( !(slew32_sync(cvSlew[cvChan])) ) { 
    cv_update(cvChan, cvSlew[cvChan].y );
  }
  */
  // FIXME: not sure why the macroized slew isn't working here.
  // something to do with access modifiers and the compiler?
  // process the current channel
  // do nothing if the value is stable
  if( filter_1p_sync( &(cvSlew[cvChan]) ) ) {
    ;;
  } else {
    // update the slew filter and store the value
      cvVal[cvChan] = filter_1p_lo_next(&(cvSlew[cvChan]));
      // send the value to the cv driver
      cv_update( cvChan, cvVal[cvChan] );
  }

  // update the channel to be processed
  if(++cvChan == 4) {
    cvChan = 0;
  }
}
예제 #2
0
파일: waves.c 프로젝트: Someone101/aleph
// frame callback
void module_process_frame(void) {

  calc_frame();

  // we could shift to fract16 at a cost of only 1b resolution

  /*

  slew32_calc(cvSlew[cvChan]);

  if( !(slew32_sync(cvSlew[cvChan])) ) { 
    dac_update(cvChan, cvSlew[cvChan].y );
  }

  */


  // something really weird going on, reverting
  if(cvSlew[cvChan].sync) { ;; } else {
    cvVal[cvChan] = filter_1p_lo_next(&(cvSlew[cvChan]));
    dac_update(cvChan, cvVal[cvChan]);
  }
 
  if(++cvChan == 4) {
    cvChan = 0;
  }
  
  /* dac_update(cvChan, cvSlew[cvChan].x); */


     
  /* cvChan++; */
  /* if(cvChan == 4) { cvChan = 0; } */
  //  cvChan = (cvChan + 1) & 3;
}
예제 #3
0
파일: tape.c 프로젝트: bbnickell/aleph
void module_process_frame(void) {
    calc_frame();
    out0 = frameVal;
    out1 = frameVal;
    out2 = frameVal;
    out3 = frameVal;
}
예제 #4
0
파일: tape.c 프로젝트: bbnickell/aleph
void module_process_frame(const f32* in, f32* out) {

    static fract32* const pIn[4] = { &in0, &in1, &in2, &in3 };
    u32 frame;
    u8 chan;
    // i/o buffers are (sometimes) interleaved in portaudio,
    // so need to introduce 1-sample delay for x-channel processing
    //  static int _in0, _in1, _in2, _in3;
    for(frame=0; frame<BLOCKSIZE; frame++) {
        calc_frame();
        for(chan=0; chan<NUMCHANNELS; chan++) { // stereo interleaved
            *out++ = fr32_to_float(frameVal);
            *(pIn[chan]) = float_to_fr32(*in++);
        }
    }
}
예제 #5
0
파일: waves.c 프로젝트: bensteinberg/aleph
// frame callback
void module_process_frame(void) {

  calc_frame();

  /* out[0] = add_fr1x32(frameVal, mult_fr1x32x32(in[0], ioAmp0)); */
  /* out[1] = add_fr1x32(frameVal, mult_fr1x32x32(in[1], ioAmp1)); */
  /* out[2] = add_fr1x32(frameVal, mult_fr1x32x32(in[2], ioAmp2)); */
  /* out[3] = add_fr1x32(frameVal, mult_fr1x32x32(in[3], ioAmp3)); */
  
  if(cvSlew[cvChan].sync) { ;; } else {
    cvVal[cvChan] = filter_1p_lo_next(&(cvSlew[cvChan]));
    dac_update(cvChan, cvVal[cvChan]);
  }
 
  if(++cvChan == 4) {
    cvChan = 0;
  }
  
}