Changeset 763a7f1 for src


Ignore:
Timestamp:
Aug 13, 2015, 6:39:40 PM (9 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
be6e8e6, bfd4414
Parents:
7b2d740
Message:

src/onset/onset.c: simplify selection of first onset

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/onset/onset.c

    r7b2d740 r763a7f1  
    6868    }
    6969  } else {
    70     // we are at the beginning of the file, and we don't find silence
    71     if (o->total_frames <= o->delay && o->last_onset < o ->minioi && aubio_silence_detection(input, o->silence) == 0) {
    72       //AUBIO_DBG ("beginning of file is not silent, marking as onset\n");
    73       isonset = o->delay / o->hop_size;
    74       o->last_onset = o->delay;
     70    // we are at the beginning of the file
     71    if (o->total_frames <= o->delay) {
     72      // and we don't find silence
     73      if (aubio_silence_detection(input, o->silence) == 0) {
     74        uint_t new_onset = o->total_frames;
     75        if (o->total_frames == 0 || o->last_onset + o->minioi < new_onset) {
     76          isonset = o->delay / o->hop_size;
     77          o->last_onset = o->total_frames + o->delay;
     78        }
     79      }
    7580    }
    7681  }
Note: See TracChangeset for help on using the changeset viewer.