MCPcopy Create free account
hub / github.com/bspaans/python-mingus / find_notes

Function find_notes

mingus/extra/fft.py:115–126  ·  view source on GitHub ↗

Convert the (frequencies, amplitude) list to a (Note, amplitude) list.

(freqTable, maxNote=100)

Source from the content-addressed store, hash-verified

113
114
115def find_notes(freqTable, maxNote=100):
116 """Convert the (frequencies, amplitude) list to a (Note, amplitude) list."""
117 res = [0] * 129
118 n = Note()
119 for (freq, ampl) in freqTable:
120 if freq > 0 and ampl > 0:
121 f = _find_log_index(freq)
122 if f < maxNote:
123 res[f] += ampl
124 else:
125 res[128] += ampl
126 return [(Note().from_int(x) if x < 128 else None, n) for (x, n) in enumerate(res)]
127
128
129def data_from_file(file):

Callers 2

find_NoteFunction · 0.85
analyze_chunksFunction · 0.85

Calls 3

NoteClass · 0.90
_find_log_indexFunction · 0.85
from_intMethod · 0.80

Tested by

no test coverage detected