cornedriesprong / mingus

Automatically exported from code.google.com/p/mingus
GNU General Public License v3.0
0 stars 0 forks source link

Incorrect output in diatonic.int_to_note #40

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

The function diatonic.int_to_note is not correct:
>>>import mingus.core.diatonic as diatonic
>>>diatonic.int_to_note(0, "D")
'C#b'
>>>diatonic.int_to_note(0, "B")
'C#b'
The outputs shown in tutorialDiatonic are not all correct too.

What version of the product are you using? On what operating system?
mingus Version 0.4.0.1
Python 2.5.4

Please provide any additional information below.

The intervals should be fixed and not shifted among different keys.
I suggest commenting out known_intervals and use the original intervals. 
The calculation will be correct then.

#known_intervals = map(lambda x: (x + current) % 12, intervals)
intervals = known_intervals

Original issue reported on code.google.com by xml...@gmail.com on 5 Jun 2009 at 8:02

GoogleCodeExporter commented 9 years ago
This is a simple fix.

Original comment by xml...@gmail.com on 5 Jun 2009 at 8:14

Attachments:

GoogleCodeExporter commented 9 years ago
Hi, thanks for reporting this problem. I have checked in a fix for this 
function; it
turned out two calls to notes.remove_redundant_accidentals were missing, which 
is
really only noticeable in some cases. The rest of the algorithm remains valid 
and
were left intact.

Release 0.4.0.2 should carry the changes. 

By the way: could you point me to errors in the tutorial? Thanks again.

Regards, Bart. 

Original comment by Rhijnauwen@gmail.com on 5 Jun 2009 at 8:29

GoogleCodeExporter commented 9 years ago
I think I may have miss-understood the purpose of this function. I thought the 
function is calculating the note name relative to the tonic note after counting 
<note_int> of semi-tones

In the tutorial,

>>> diatonic.int_to_note(10, "C")
'A#' <-- No Problem for C key

>>> diatonic.int_to_note(10, "F")
'Bb' <-- If in F Key, 0 is F, 1 is F#, 2 is G, I thought 10 should be Ab. But 
now I discover 
that you are always pointing 10 to the same note, and just giving different 
note 
names: Bb or A# according to the key.

>>> diatonic.int_to_note(11, "C")
'B' <-- No Problem for C key

>>> diatonic.int_to_note(11, "Gb")
'Cb' <-- I thought this was F, one semi-tone before Gb. But again you are 
always 
pointing 11 to Cb or B.

Original comment by xml...@gmail.com on 5 Jun 2009 at 8:51

GoogleCodeExporter commented 9 years ago
I can definitely see where your confusion is coming from and I'm thinking the 
purpose
of this function should be made more clear in the documentation. You still 
stumbled
upon a bug though; so thanks / sorry for that ;)

Best regards, Bart.

Original comment by Rhijnauwen@gmail.com on 5 Jun 2009 at 9:24

GoogleCodeExporter commented 9 years ago
This issue was closed by revision e0ef7ae4a8.

Original comment by Rhijnauwen@gmail.com on 8 Dec 2009 at 4:42