Changeset dedeffc for python


Ignore:
Timestamp:
Nov 20, 2013, 2:50:37 AM (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:
aad688e
Parents:
1e1a2c9
Message:

python/demos/demo_sink_create_woodblock.py: fix wavetable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/demos/demo_sink_create_woodblock.py

    r1e1a2c9 rdedeffc  
    3333for i in range(duration):
    3434    x = int((i % period) / float(period) * tablelen)
    35     sinetone[i] = (sinetable[x] + sinetable[x+1]) / 2
     35    idx = int(x)
     36    frac = x - idx
     37    a = sinetable[idx]
     38    b = sinetable[idx + 1]
     39    sinetone[i] = a + frac * (b -a)
    3640
    3741# apply some envelope
     
    4044sinetone[:attack] *= exp( e * ( float_ramp[:attack] / attack - 1 ) )
    4145
    42 if 0:
     46if 1:
    4347    import matplotlib.pyplot as plt
    4448    plt.plot(sinetone)
Note: See TracChangeset for help on using the changeset viewer.