Ignore:
Timestamp:
Mar 10, 2017, 2:26:32 PM (7 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, sampler
Children:
ee8a57c
Parents:
00d0275 (diff), 67b6618 (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 awhitening

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/demos/demo_sink_create_woodblock.py

    r00d0275 r155cc10  
    33import sys
    44from math import pi, e
    5 from aubio import sink
    6 from numpy import arange, resize, sin, exp, zeros
     5from aubio import sink, float_type
     6from numpy import arange, sin, exp, zeros
    77
    88if len(sys.argv) < 2:
    9     print 'usage: %s <outputfile> [samplerate]' % sys.argv[0]
     9    print('usage: %s <outputfile> [samplerate]' % sys.argv[0])
    1010    sys.exit(1)
    1111
     
    2626# create a sine lookup table
    2727tablelen = 1000
    28 sinetable = arange(tablelen + 1, dtype = 'float32')
     28sinetable = arange(tablelen + 1, dtype = float_type)
    2929sinetable = 0.7 * sin(twopi * sinetable/tablelen)
    30 sinetone = zeros((duration,), dtype = 'float32')
     30sinetone = zeros((duration,), dtype = float_type)
    3131
    3232# compute sinetone at floating point period
     
    4040
    4141# apply some envelope
    42 float_ramp = arange(duration, dtype = 'float32')
     42float_ramp = arange(duration, dtype = float_type)
    4343sinetone *= exp( - e * float_ramp / duration / decay)
    4444sinetone[:attack] *= exp( e * ( float_ramp[:attack] / attack - 1 ) )
Note: See TracChangeset for help on using the changeset viewer.