In [1]:
%matplotlib inline
import json
from tonicidentifier.toniclastnote import TonicLastNote
from pitchfilter.pitchfilter import PitchFilter
In [2]:
pitch = json.load(open("sample_data/cab08727-d5c2-4fda-9d96-d107915a85ec.json", 'r'))['pitch']
# Post process the pitch track to get rid of spurious pitch estimations and correct octave errors
flt = PitchFilter()
pitch = flt.run(pitch)
In [3]:
tonic_identifier = TonicLastNote()
tonic, pitch_sliced, pitch_chunks, distribution = tonic_identifier.identify(pitch)
In [4]:
tonic_identifier.plot(pitch_sliced, tonic, pitch_chunks, distribution)