Ignore:
Timestamp:
Jun 22, 2016, 1:00:10 PM (8 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:
4b9443c4
Parents:
60fc05b (diff), 6769586 (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 notes

File:
1 edited

Legend:

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

    r60fc05b rf264b17  
    22
    33import numpy
    4 from _aubio import *
    5 from midiconv import *
    6 from slicing import *
     4from ._aubio import *
     5from ._aubio import float_type
     6from .midiconv import *
     7from .slicing import *
    78
    89class fvec(numpy.ndarray):
    9     " a simple numpy array holding a vector of float32 "
    10     def __new__(self, length = 1024, **kwargs):
    11         self.length = length
    12         if type(length) == type([]):
    13             return numpy.array(length, dtype='float32', **kwargs)
    14         return numpy.zeros(length, dtype='float32', **kwargs)
     10    """a numpy vector holding audio samples"""
     11
     12    def __new__(cls, input_arg=1024, **kwargs):
     13        if isinstance(input_arg, int):
     14            if input_arg == 0:
     15                raise ValueError("vector length of 1 or more expected")
     16            return numpy.zeros(input_arg, dtype=float_type, **kwargs)
     17        else:
     18            return numpy.array(input_arg, dtype=float_type, **kwargs)
Note: See TracChangeset for help on using the changeset viewer.