Ignore:
Timestamp:
Oct 30, 2018, 1:22:44 PM (5 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
Children:
152bf4f
Parents:
f9400d0 (diff), 4bc10e2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into feature/docstrings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/tests/test_note2midi.py

    rf9400d0 red596f7  
    44from __future__ import unicode_literals
    55
    6 from aubio import note2midi, freq2note
     6from aubio import note2midi, freq2note, note2freq, float_type
    77from nose2.tools import params
    88import unittest
     
    112112class freq2note_simple_test(unittest.TestCase):
    113113
    114     def test_freq2note(self):
     114    def test_freq2note_above(self):
    115115        " make sure freq2note(441) == A4 "
    116116        self.assertEqual("A4", freq2note(441))
     117
     118    def test_freq2note_under(self):
     119        " make sure freq2note(439) == A4 "
     120        self.assertEqual("A4", freq2note(439))
     121
     122class note2freq_simple_test(unittest.TestCase):
     123
     124    def test_note2freq(self):
     125        " make sure note2freq('A3') == 220"
     126        self.assertEqual(220, note2freq("A3"))
     127
     128    def test_note2freq_under(self):
     129        " make sure note2freq(A4) == 440"
     130        if float_type == 'float32':
     131            self.assertEqual(440, note2freq("A4"))
     132        else:
     133            self.assertLess(abs(note2freq("A4")-440), 1.e-12)
    117134
    118135if __name__ == '__main__':
Note: See TracChangeset for help on using the changeset viewer.