-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"pychord.analyzer.note_to_chord" wrong chord calculated #26
Comments
@mullerjurgen >>> from pychord.analyzer import note_to_chord
>>> cs = note_to_chord(["D","F","G#","B"])
>>> cs
[<Chord: Ddim6>, <Chord: Fdim6/D>, <Chord: G#dim6/D>, <Chord: Bdim6/D>]
>>> cs[0].components(visible=True)
['D', 'F', 'G#', 'B']
>>> for c in cs:
... print(c.components(True))
...
['D', 'F', 'G#', 'B']
['D', 'F', 'Ab', 'B', 'D']
['D', 'G#', 'B', 'D', 'F']
['D', 'B', 'D', 'F', 'G#']
>>> cs = note_to_chord(["D","F","G#","B"])
>>> for c in cs:
... print(c.components(True))
...
['D', 'F', 'G#', 'B']
['D', 'F', 'Ab', 'B', 'D']
['D', 'G#', 'B', 'D', 'F']
['D', 'B', 'D', 'F', 'G#'] |
Dear Yuma,
I hope, this is your firstname.
thank you for your help.
This part is working fine now. Thank you very much.
I don’t want open a new issue without to discuss with you before.
I am using „pychord“ in realtime. That means, that I try to find the chord that I have pressed with my left hand.
As you can imagine the program receives a lot of MIDI data.
After I have changed the keys with my left hand a few times, the method „note_to_chord“ dosn’t work correctly. The result is an empty list (=[]) .
Unfortunately my program is not longer working becauce of this issue.
What do you think, shall I open a new issue?
The problem is, I cannot write a test program raising the problem.
Jürgen Müller
Von: Yuma Mihira [mailto:notifications@github.com]
Gesendet: Mittwoch, 6. Februar 2019 16:34
An: yuma-m/pychord
Cc: mullerjurgen; Mention
Betreff: Re: [yuma-m/pychord] "pychord.analyzer.note_to_chord" wrong chord calculated (#26)
@mullerjurgen <https://github.com/mullerjurgen>
Thank you for reporting the bug.
I fixed it in #27 <#27> and it will work like below.
>> from pychord.analyzer import note_to_chord
>> cs = note_to_chord(["D","F","G#","B"])
>> cs
[<Chord: Ddim6>, <Chord: Fdim6/D>, <Chord: G#dim6/D>, <Chord: Bdim6/D>]
>> cs[0].components(visible=True)
['D', 'F', 'G#', 'B']
>> for c in cs:
... print(c.components(True))
...
['D', 'F', 'G#', 'B']
['D', 'F', 'Ab', 'B', 'D']
['D', 'G#', 'B', 'D', 'F']
['D', 'B', 'D', 'F', 'G#']
>> cs = note_to_chord(["D","F","G#","B"])
>> for c in cs:
... print(c.components(True))
...
['D', 'F', 'G#', 'B']
['D', 'F', 'Ab', 'B', 'D']
['D', 'G#', 'B', 'D', 'F']
['D', 'B', 'D', 'F', 'G#']
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#26 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AsqmzIoAxB2fv7VklZxyLg2CzvorWpViks5vKvXNgaJpZM4aj8Je> . <https://github.com/notifications/beacon/AsqmzL4uPLnfPW4iKLuSG-XsicL53M-_ks5vKvXNgaJpZM4aj8Je.gif>
|
Hello Jürgen, Thank you for reporting the issue.
Yes, would you mind opening a new issue with the program which can reproduce the bug? |
Dear all,
the example on the bottom shows the problems with "pychord.analyzer.note_to_chord"
Calling this function the second time using the same parameters returns a different result.
Debugging shows that def: "find_quality" in "pychord/pychord/analyzer.py" has a reference to "QUALITY_DICT" that includes crahed data in "dim6". Try this example and you will see.
-- coding: utf-8 --
#!/usr/bin/env python3
Imports
from future import print_function
import sys
from pychord.analyzer import note_to_chord
from pychord.utils import val_to_note
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Constants
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
k_NOTE_OFF = 0
k_NOTE_ON = 1
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Chords
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
def chord_receive(info,n1,n2,n3,n4):
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Main
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
try:
chord_receive("first","D","F","G#","B")
chord_receive("second","D","F","G#","B")
except KeyboardInterrupt:
pass
The text was updated successfully, but these errors were encountered: