Logo Search packages:      
Sourcecode: rakarrack version File versions  Download package

Tuner.h

/* tuneit.c -- Detect fundamental frequency of a sound
 * Copyright (C) 2004, 2005  Mario Lang <mlang@delysid.org>
 *
 * Modified for rakarrack by Daniel Vidal & Josep Andreu
 * tune.h  Tuner definitions
 * This is free software, placed under the terms of the
 * GNU General Public License, as published by the Free Software Foundation.
 * Please see the file COPYING for details.
 */



#ifndef TUNER_H_
#define TUNER_H_

#include <math.h>
#include <stdlib.h>

#define REALTYPE float

#define D_NOTE          1.059463094359
#define LOG_D_NOTE      0.057762265047
#define D_NOTE_SQRT     1.029302236643
#define LOG_2           0.693147180559
#define M_PI 3.14159265358979323846
#define MAX_PEAKS 8


class Tuner
{
public:
  Tuner (REALTYPE * efxoutl_, REALTYPE * efxoutr_);
  ~Tuner ();

  REALTYPE *efxoutl;
  REALTYPE *efxoutr;
  signed short int *schmittBuffer;
  signed short int *schmittPointer;
  const char **notes;
  int note;
  int preparada;
  int note_actual;
  float nfreq, afreq, freq;
  int cents;
  void schmittFloat (int nframes, float *indatal, float *indatar);
private:


  float freqs[12];
  float lfreqs[12];
  int blockSize;
  void displayFrequency (float freq);
  void schmittInit (int size);
  void schmittS16LE (int nframes, signed short int *indata);
  void schmittFree ();
};

#endif /*TUNER_H_ */

Generated by  Doxygen 1.6.0   Back to index