Skip to content

Commit

Permalink
Forward quality parameter #6
Browse files Browse the repository at this point in the history
  • Loading branch information
jurihock committed Sep 9, 2023
1 parent a7f02c9 commit 30a278a
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions python/src/qdft/chroma.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

class Chroma:

def __init__(self, samplerate, concertpitch=440, bandwidth=('A0', 'C#8'), latency=0, decibel=True, feature=None):
def __init__(self, samplerate, concertpitch=440, bandwidth=('A0', 'C#8'), quality=0, latency=0, decibel=True, feature=None):

scale = Scale(concertpitch)

Expand All @@ -31,7 +31,11 @@ def __init__(self, samplerate, concertpitch=440, bandwidth=('A0', 'C#8'), latenc
notes = numpy.array([scale.note(semitone) for semitone in semitones])
octaves = numpy.array([scale.octave(frequency) for frequency in frequencies])

qdft = QDFT(samplerate=samplerate, bandwidth=(fmin, fmax), resolution=24, latency=latency)
qdft = QDFT(samplerate=samplerate,
bandwidth=(fmin, fmax),
resolution=24,
quality=quality,
latency=latency)
assert numpy.allclose(qdft.frequencies[::2], frequencies)

size = qdft.size // 2
Expand Down Expand Up @@ -88,9 +92,15 @@ def chroma(self, samples):

class Chroma12:

def __init__(self, samplerate, concertpitch=440, bandwidth=('A0', 'C#8'), latency=0):
def __init__(self, samplerate, concertpitch=440, bandwidth=('A0', 'C#8'), quality=0, latency=0):

superchroma = Chroma(samplerate, concertpitch, bandwidth, latency, decibel=False, feature=None)
superchroma = Chroma(samplerate=samplerate,
concertpitch=concertpitch,
bandwidth=bandwidth,
quality=quality,
latency=latency,
decibel=False,
feature=None)

notes = superchroma.scale.scale
size = len(notes)
Expand Down

0 comments on commit 30a278a

Please sign in to comment.