Git Product home page Git Product logo

Comments (7)

bmcfee avatar bmcfee commented on July 26, 2024

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?

from muda.

wangsix avatar wangsix commented on July 26, 2024

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?

from muda.

bmcfee avatar bmcfee commented on July 26, 2024

Oh, I think maybe that iterator should be wrapped as enumerate(pitch.transform(jams_obj))?

(Currently on mobile, otherwise would test it myself)

from muda.

wangsix avatar wangsix commented on July 26, 2024

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!

from muda.

bmcfee avatar bmcfee commented on July 26, 2024

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!

from muda.

wangsix avatar wangsix commented on July 26, 2024

No problem, I will do a PR later!

On Feb 26, 2016, at 15:51, Brian McFee [email protected] 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.

from muda.

bmcfee avatar bmcfee commented on July 26, 2024

I'm closing this one out -- I think the original cause of this report is better handled within pyrubberband.

from muda.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.