class RhythmicExtractionUtil implements OnsetHandler {

    public List<Integer[]> getOnsetIndexes(Double[] onsetTimes, int barCount, float barInSec) {

        List<Integer[]> onsetIndexCollection = new ArrayList<>();

        for (int bc = 0; bc < barCount; bc++) {
            Integer[] onsetIndexes = new Integer[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

            double sixteenthInterval = 0.1875;
            double intervalWindow = sixteenthInterval / 2;

            for (int i = 0; i < onsetIndexes.length; i++) {

                for (double onsetTime : onsetTimes) {

                    if (i == 0) {
                        if (onsetTime - ((float) bc * barInSec) > (sixteenthInterval * i) - intervalWindow &&
                                onsetTime - ((float) bc * barInSec) <= (sixteenthInterval * i) + intervalWindow) {
                            onsetIndexes[i] = 1;
                        }
                    } else {
                        if (onsetTime - ((float) bc * barInSec) > (sixteenthInterval * i) - intervalWindow &&
                                onsetTime - ((float) bc * barInSec) <= (sixteenthInterval * i) + intervalWindow) {
                            onsetIndexes[i] = 1;
                        }
                    }
                }
            }

            onsetIndexCollection.add(onsetIndexes);
        }

        return onsetIndexCollection;
    }

    @Autowired public  RhythmicExtractionUtil(IBeatLoopsDal beatLoopsDal,IHarmonicLoopsDal harmonicLoopsDal, AppConfigs appConfigs, IAudioUtils audioUtils);

}