echonest / remix

Echo Nest Remix: The Internet Synthesizer
http://echonest.github.com/remix
414 stars 90 forks source link

Some examples do not run under NumPy 1.7 (Linux) #13

Closed lordastley closed 11 years ago

lordastley commented 11 years ago

Any example with the following line (or other lines multiplying the audio matrix by fractional/float values) self.audiofile.data = linear(self.audiofile.analysis.loudness, -2, -12, 0.5, 1.5) \ 0.75

Throws this error: TypeError: Cannot cast ufunc multiply output from dtype('float64') to dtype('int16') with casting rule 'same_kind'

Scripts which do not run include: add_blips cowbell jingler

Installed packages (abbreviated to python and ffmpeg) remix (6a925804ff40a11342ec142dbcc8ca66b5aa56da from 12/12/12) python2 2.7.3-3 python2-beaker 1.6.3-2 python2-chardet 2.0.1-6 python2-crypto 2.6-3 python2-distribute 0.6.30-1 python2-gdata 2.0.17-3 python2-mako 0.7.2-2 python2-markupsafe 0.15-2 python2-numpy 1.7.0-1 python2-pyopenssl 0.13-2 python2-tweepy-git 20121101-1 python2-xdg 0.23-2 python2-zope-interface 4.0.1-1 ffmpeg 1:1.0.1-1

Uname Linux 3.6.6-1-ARCH #1 SMP PREEMPT Mon Nov 5 13:14:42 CET 2012 i686 GNU/Linux

tkell commented 11 years ago

Will check this out and try to sneak better casting in. Thanks for the heads up!

tkell commented 11 years ago

Hrm. I can't recreate this with NumPy 1.7.0rc1. Were you on 1.7.0 beta 1?

Thanks, Thor

lordastley commented 11 years ago

It looks like I was on 1.7.0b2, as that's what's (still) in the Arch repos.

tkell commented 11 years ago

Gotcha. I'll confirm that and make sure that it doesn't break in the released version of 1.7.0. Thanks for the catch!

drepetto commented 11 years ago

Just FYI, this is still broken. I'm using:

module 'numpy' from '/Library/Python/2.7/site-packages/numpy-1.8.0.dev_9597b1f_20120920-py2.7-macosx-10.8-x86_64.egg/numpy/init.pyc'

drepetto commented 11 years ago

A quick fix is to change the offending line in audio.py's megamix to:

    newdata.data[:newseg.endindex] += (newseg.data / float(len(dataList))).astype(newdata.data.dtype)
tkell commented 11 years ago

Thank drepetto, just added that.

tkell commented 11 years ago

Tested with Numpy 1.7.0 - I'm going to close this one. If similar issues appear, please open a new issue.

Thanks! Thor