annotate base/Pitch.h @ 223:51af92c83dfc github-meta

Some notes toward moving primary to Github
author Chris Cannam
date Thu, 23 May 2019 15:18:24 +0100
parents 0d3b3c66652b
children fdaa63607c15
rev   line source
cannam@0 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
cannam@0 2
cannam@0 3 /*
cannam@0 4 QM DSP library
cannam@0 5 Centre for Digital Music, Queen Mary, University of London.
cannam@0 6 This file Copyright 2006 Chris Cannam.
Chris@84 7
Chris@84 8 This program is free software; you can redistribute it and/or
Chris@84 9 modify it under the terms of the GNU General Public License as
Chris@84 10 published by the Free Software Foundation; either version 2 of the
Chris@84 11 License, or (at your option) any later version. See the file
Chris@84 12 COPYING included with this distribution for more information.
cannam@0 13 */
cannam@0 14
cannam@0 15 #ifndef _PITCH_H_
cannam@0 16 #define _PITCH_H_
cannam@0 17
Chris@152 18 /**
Chris@152 19 * Convert between musical pitch (i.e. MIDI pitch number) and
Chris@152 20 * fundamental frequency.
Chris@152 21 */
cannam@0 22 class Pitch
cannam@0 23 {
cannam@0 24 public:
cannam@0 25 static float getFrequencyForPitch(int midiPitch,
cannam@0 26 float centsOffset = 0,
cannam@0 27 float concertA = 440.0);
cannam@0 28
cannam@0 29 static int getPitchForFrequency(float frequency,
cannam@0 30 float *centsOffsetReturn = 0,
cannam@0 31 float concertA = 440.0);
cannam@0 32 };
cannam@0 33
cannam@0 34
cannam@0 35 #endif