Changeset 7d89e61 for python/lib


Ignore:
Timestamp:
Mar 10, 2013, 5:37:28 PM (11 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

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.