Changeset 7d89e61


Ignore:
Timestamp:
Mar 10, 2013, 5:37:28 PM (12 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, pitchshift, sampler, timestretch, yinfft+
Children:
8c4560e
Parents:
9ead7a9
Message:

tests/test_{midi2note,note2midi}.py: add header and encoding

Location:
python
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • python/lib/aubio/midiconv.py

    r9ead7a9 r7d89e61  
    1 # -*- encoding: utf8 -*-
     1# -*- coding: utf-8 -*-
    22
    33def note2midi(note):
     
    55    _valid_notenames = {'C': 0, 'D': 2, 'E': 4, 'F': 5, 'G': 7, 'A': 9, 'B': 11}
    66    _valid_modifiers = {None: 0, u'♮': 0, '#': +1, u'♯': +1, u'\udd2a': +2, 'b': -1, u'♭': -1, u'\ufffd': -2}
    7     _valid_octaves = range(-1, 10) 
     7    _valid_octaves = range(-1, 10)
    88    if type(note) not in (str, unicode):
    99        raise TypeError, "a string is required, got %s" % note
  • python/tests/test_midi2note.py

    • Property mode changed from 100644 to 100755
    r9ead7a9 r7d89e61  
    1 # -*- encoding: utf8 -*-
     1#! /usr/bin/env python
     2# -*- coding: utf-8 -*-
    23
    34from aubio import midi2note
     
    1415        )
    1516
    16 class TestMidi2NoteGoodValues(unittest.TestCase):
     17class midi2note_good_values(unittest.TestCase):
    1718
    1819    def test_midi2note_known_values(self):
     
    2122            self.assertEqual ( midi2note(midi), note )
    2223
    23 class TestNote2MidiWrongValues(unittest.TestCase):
     24class midi2note_wrong_values(unittest.TestCase):
    2425
    2526    def test_midi2note_negative_value(self):
  • python/tests/test_note2midi.py

    r9ead7a9 r7d89e61  
    1 # -*- encoding: utf8 -*-
     1#! /usr/bin/env python
     2# -*- coding: utf-8 -*-
    23
    34from aubio import note2midi
     
    2324        )
    2425
    25 class TestNote2MidiGoodValues(unittest.TestCase):
     26class note2midi_good_values(unittest.TestCase):
    2627
    2728    def test_note2midi_known_values(self):
     
    3031            self.assertEqual ( note2midi(note), midi )
    3132
    32 class TestNote2MidiWrongValues(unittest.TestCase):
     33class note2midi_wrong_values(unittest.TestCase):
    3334
    3435    def test_note2midi_missing_octave(self):
Note: See TracChangeset for help on using the changeset viewer.