Changeset 7d89e61
- Timestamp:
- Mar 10, 2013, 5:37:28 PM (12 years ago)
- 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
- Location:
- python
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
python/lib/aubio/midiconv.py
r9ead7a9 r7d89e61 1 # -*- encoding: utf8 -*-1 # -*- coding: utf-8 -*- 2 2 3 3 def note2midi(note): … … 5 5 _valid_notenames = {'C': 0, 'D': 2, 'E': 4, 'F': 5, 'G': 7, 'A': 9, 'B': 11} 6 6 _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) 8 8 if type(note) not in (str, unicode): 9 9 raise TypeError, "a string is required, got %s" % note -
python/tests/test_midi2note.py
-
Property
mode
changed from
100644
to100755
r9ead7a9 r7d89e61 1 # -*- encoding: utf8 -*- 1 #! /usr/bin/env python 2 # -*- coding: utf-8 -*- 2 3 3 4 from aubio import midi2note … … 14 15 ) 15 16 16 class TestMidi2NoteGoodValues(unittest.TestCase):17 class midi2note_good_values(unittest.TestCase): 17 18 18 19 def test_midi2note_known_values(self): … … 21 22 self.assertEqual ( midi2note(midi), note ) 22 23 23 class TestNote2MidiWrongValues(unittest.TestCase):24 class midi2note_wrong_values(unittest.TestCase): 24 25 25 26 def test_midi2note_negative_value(self): -
Property
mode
changed from
-
python/tests/test_note2midi.py
r9ead7a9 r7d89e61 1 # -*- encoding: utf8 -*- 1 #! /usr/bin/env python 2 # -*- coding: utf-8 -*- 2 3 3 4 from aubio import note2midi … … 23 24 ) 24 25 25 class TestNote2MidiGoodValues(unittest.TestCase):26 class note2midi_good_values(unittest.TestCase): 26 27 27 28 def test_note2midi_known_values(self): … … 30 31 self.assertEqual ( note2midi(note), midi ) 31 32 32 class TestNote2MidiWrongValues(unittest.TestCase):33 class note2midi_wrong_values(unittest.TestCase): 33 34 34 35 def test_note2midi_missing_octave(self):
Note: See TracChangeset
for help on using the changeset viewer.