Closed wangsix closed 8 years ago
Yikes, that's the least helpful error message I've ever seen.
The first thing I can think of: do you have rubberband installed and in your path?
Thank you so much Brian! Rubberband was not installed as you said. Thank you for pointing that out for me. Now the same code returns the following:
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-6-ba2efbb97ebe> in <module>()
----> 1 for i, jam_out in pitch.transform(jams_obj):
2 muda.save('output_{:02d}.wav'.format(i),
3 'output_{:02d}.jams'.format(i),
4 jam_out)
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/jams/core.pyc in __getitem__(self, key)
262 def __getitem__(self, key):
263 """Dict-style interface"""
--> 264 return self.__dict__[key]
265
266 def __setattr__(self, name, value):
KeyError: 0
I could only guess am I using the generator in a wrong way?
Oh, I think maybe that iterator should be wrapped as enumerate(pitch.transform(jams_obj))
?
(Currently on mobile, otherwise would test it myself)
You are right! I should have spot that as well. Just FYI, I was lazily copying the code from the documentation. I just added enumerate()
and it worked! Thank you!
Glad it's working, and sorry for the incorrect example code! I'll fix it when I'm back on a real machine.
Alternately, a PR would be greatly appreciated if you want to take a stab at it.
Thanks for pointing this out!
No problem, I will do a PR later!
On Feb 26, 2016, at 15:51, Brian McFee notifications@github.com wrote:
Glad it's working, and sorry for the incorrect example code! I'll fix it when I'm back on a real machine.
Alternately, a PR would be greatly appreciated if you want to take a stab at it.
Thanks for pointing this out!
— Reply to this email directly or view it on GitHub.
I'm closing this one out -- I think the original cause of this report is better handled within pyrubberband.
I probably missed something very basic. So I was trying to test the muda code examples from the documentation as follows.
jams_obj = muda.load_jam_audio(jam_file, song_file)
pitch = muda.deformers.LinearPitchShift(n_samples=5, lower=-2, upper=2)
and I encountered the following error message:
Please give me any pointers on what I have been missing... I checked the content of jams_obj and the audio is loaded.