Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/onset/onset.c

    r3e17aed r0b9a02a  
    4848  smpl_t isonset = 0;
    4949  smpl_t wasonset = 0;
    50   uint_t i;
    5150  aubio_pvoc_do (o->pv,input, o->fftgrain);
    5251  aubio_specdesc_do (o->od,o->fftgrain, o->of);
    53   /*if (usedoubled) {
    54     aubio_specdesc_do (o2,fftgrain, onset2);
    55     onset->data[0][0] *= onset2->data[0][0];
    56   }*/
    5752  aubio_peakpicker_do(o->pp, o->of, onset);
    58   for (i = 0; i < input->channels; i++) {
    59   isonset = onset->data[i][0];
    60   wasonset = o->wasonset->data[i][0];
     53  isonset = onset->data[0];
     54  wasonset = o->wasonset->data[0];
    6155  if (isonset > 0.) {
    6256    if (aubio_silence_detection(input, o->silence)==1) {
     
    7468    wasonset++;
    7569  }
    76   o->wasonset->data[i][0] = wasonset;
    77   onset->data[i][0] = isonset;
    78   }
     70  o->wasonset->data[0] = wasonset;
     71  onset->data[0] = isonset;
    7972  return;
    8073}
     
    9891/* Allocate memory for an onset detection */
    9992aubio_onset_t * new_aubio_onset (char_t * onset_mode,
    100     uint_t buf_size, uint_t hop_size, uint_t channels, uint_t samplerate)
     93    uint_t buf_size, uint_t hop_size, uint_t samplerate)
    10194{
    10295  aubio_onset_t * o = AUBIO_NEW(aubio_onset_t);
     
    10598  o->minioi    = 4;
    10699  o->silence   = -70;
    107   o->wasonset  = new_fvec(1, channels);
     100  o->wasonset  = new_fvec(1);
    108101  o->samplerate = samplerate;
    109102  o->hop_size = hop_size;
    110   o->pv = new_aubio_pvoc(buf_size, hop_size, channels);
    111   o->pp = new_aubio_peakpicker(channels);
     103  o->pv = new_aubio_pvoc(buf_size, hop_size);
     104  o->pp = new_aubio_peakpicker();
    112105  aubio_peakpicker_set_threshold (o->pp, o->threshold);
    113   o->od = new_aubio_specdesc(onset_mode,buf_size,channels);
    114   o->fftgrain = new_cvec(buf_size,channels);
    115   o->of = new_fvec(1, channels);
     106  o->od = new_aubio_specdesc(onset_mode,buf_size);
     107  o->fftgrain = new_cvec(buf_size);
     108  o->of = new_fvec(1);
    116109  /*if (usedoubled)    {
    117     o2 = new_aubio_specdesc(onset_type2,buffer_size,channels);
    118     onset2 = new_fvec(1 , channels);
     110    o2 = new_aubio_specdesc(onset_type2,buffer_size);
     111    onset2 = new_fvec(1);
    119112  }*/
    120113  return o;
Note: See TracChangeset for help on using the changeset viewer.