Skip to content

Commit bb54d45

Browse files
add frequency_to_note_cents function; update docs
1 parent 9682d76 commit bb54d45

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cedargrove_midi_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def frequency_to_note_cents(frequency):
136136
if (pow(2, (0 - 69) / 12) * 440) <= frequency <= (pow(2, (128 - 69) / 12) * 440):
137137
note = int(69 + (12 * log(frequency / 440, 2)))
138138
note_freq = pow(2, (note - 69) / 12) * 440
139-
return note, int(1200 * log(frequency / note_freq))
139+
return note, int(1200 * log(frequency / note_freq, 2))
140140
return None, None # Frequency outside valid range
141141

142142

0 commit comments

Comments
 (0)