Comments (5)
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.
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.
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.
That makes sense. Thank you so much!
from musicpy.
You are welcome.
from musicpy.
Related Issues (20)
- 'str' object has no attribute 'track_number' HOT 1
- Can you provide a basic example of how to use the sampler HOT 2
- Can't load the module if there is no audio interface HOT 1
- Sampler doesn't properly handle 32bit wav files HOT 1
- Note example HOT 1
- Unable to set volume for tracks HOT 2
- 请教大佬如何在一个chord的起始位置添加休止符? HOT 3
- split_melody返回的note对象 HOT 2
- 这里是不是没有考虑num小于0的情况呀 HOT 1
- 这里是不是应该修改为 current_note = self[current_degree-1].name HOT 1
- Demos won't work without an explicit sleep HOT 7
- 翻譯和弦判斷算法github wiki的文檔 HOT 5
- Friendly reminder of updating the scale page on Wiki HOT 1
- Question about running code in colab enviroment and exporting as midi / wav file HOT 5
- 关于让构建和弦时和弦音的显示更符合乐理的建议 HOT 1
- error: mixer not initialized HOT 3
- [feature req] Integration with hookpad ? HOT 1
- nice to have complete note conversion feature HOT 1
- 速查表在 readthedocs 网页端的排版问题 | Layout Problem of Cheat Sheet on Readthedocs Web Pages HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from musicpy.