- Timestamp:
- Apr 19, 2016, 12:44:46 AM (9 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:
- 9b7f238
- Parents:
- 376d5e9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/lib/aubio/midiconv.py
r376d5e9 re76842e 1 1 # -*- coding: utf-8 -*- 2 3 import sys 4 PY3 = sys.version_info[0] == 3 5 if PY3: 6 string_types = [str] 7 else: 8 string_types = [str, unicode] 2 9 3 10 def note2midi(note): … … 6 13 _valid_modifiers = {None: 0, u'♮': 0, '#': +1, u'♯': +1, u'\udd2a': +2, 'b': -1, u'♭': -1, u'\ufffd': -2} 7 14 _valid_octaves = range(-1, 10) 8 if type(note) not in (str, unicode):9 raise TypeError("a string is required, got %s " % note)15 if type(note) not in string_types: 16 raise TypeError("a string is required, got %s (%s)" % (note, str(type(note)) )) 10 17 if not (1 < len(note) < 5): 11 18 raise ValueError(
Note: See TracChangeset
for help on using the changeset viewer.