Code Monkey home page Code Monkey logo

Comments (5)

Rainbow-Dreamer avatar Rainbow-Dreamer commented on June 2, 2024

For the line chord = [mp.C(i['chd']) % (i['time'], i['arp']) for i in chp], this sets the duration and interval for the chord, so I suggest the better naming for time and arp should be duration and interval.
If you want to set the durations and intervals for each note in the chord, the value for duration and interval should both be a list, the lists contain the duration and interval for each note. If you set the value for duration and interval to be a float, which is in your case, this set all of the notes has the exactly same duration and interval to that float.
So here is an example:

{
  "chd": "Cm7",
  "duration": [0.5, 0.5, 0.5, 0.5],
  "interval": [0.5, 0.5, 0, 0],
  "start": 0,
  "inst": "Acoustic Grand Piano"
}

In this example, the duration could also be just 0.5, which is equivalent.
I hope this helps.

from musicpy.

akhilsadam avatar akhilsadam commented on June 2, 2024

Thank you.
My question was more related to the chord_analysis function.
So for the example I gave above, I only get a single chord when I run chord_analysis, is that expected behavior?

I assumed that I was not setting the intervals correctly, but by your clarification, that should not be the problem.

Thank you for the the naming suggestions; those names are much more informative.

from musicpy.

Rainbow-Dreamer avatar Rainbow-Dreamer commented on June 2, 2024

I see, this is not the expected behavior, since you are writing a chord progression only, so you can set the parameter is_chord to True in the chord_analysis function, which will treat the input chord instance as chord only, instead of a whole piece (which means chords and melodies altogether), by default, the is_chord parameter is set to False, in this case, the function will firstly do a split melody and chord algorithm operation, then try to analysis the chord part. Here I have an example for you:

chord_progression1 = C('Cm7') | C('D') | C('E')
>>> chord_analysis(chord_progression1 , is_chord=True)
['Cm7', 'Dmajor', 'Emajor']

from musicpy.

akhilsadam avatar akhilsadam commented on June 2, 2024

That makes sense. Thank you so much!

from musicpy.

Rainbow-Dreamer avatar Rainbow-Dreamer commented on June 2, 2024

You are welcome.

from musicpy.

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.