Chris@49: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@19: Chris@19: /* Chris@52: Sonic Visualiser Chris@52: An audio file viewer and annotation editor. Chris@52: Centre for Digital Music, Queen Mary, University of London. Chris@52: This file copyright 2006 Chris Cannam. Chris@19: Chris@52: This program is free software; you can redistribute it and/or Chris@52: modify it under the terms of the GNU General Public License as Chris@52: published by the Free Software Foundation; either version 2 of the Chris@52: License, or (at your option) any later version. See the file Chris@52: COPYING included with this distribution for more information. Chris@19: */ Chris@19: Chris@19: #ifndef _PITCH_H_ Chris@19: #define _PITCH_H_ Chris@19: Chris@19: #include Chris@19: Chris@19: class Pitch Chris@19: { Chris@19: public: Chris@141: /* If concertA <= 0, it will be taken from current preferences */ Chris@141: Chris@19: static float getFrequencyForPitch(int midiPitch, Chris@19: float centsOffset = 0, Chris@141: float concertA = 0.0); Chris@19: Chris@19: static int getPitchForFrequency(float frequency, Chris@19: float *centsOffsetReturn = 0, Chris@141: float concertA = 0.0); Chris@19: Chris@19: static QString getPitchLabel(int midiPitch, Chris@26: float centsOffset = 0, Chris@26: bool useFlats = false); Chris@19: Chris@19: static QString getPitchLabelForFrequency(float frequency, Chris@141: float concertA = 0.0, Chris@26: bool useFlats = false); Chris@19: }; Chris@19: Chris@19: Chris@19: #endif