Hi there,
I need really urgent help with a more complex issue. But I would be really grateful if someone could help me there
My goal is the following: I want to get with my python program a list of times when there is a change in the harmony of a song. That means, if for example a C-Major chord is played until second 3 (from the beginning), and from then on G-Major, then I want to find out this point in time.
That actually already works.
Only my big problem is now the following: These times are VERY inaccurate and I have already tried many things to make it more accurate.
I wanted to ask now, whether anyone can give me there tips?
#load the audio file
y, sr = librosa.load(audiofile, offset=10, duration=30, sr=sr)
y = librosa.effects.harmonic(y=y, margin=8)
#Apply Filters
chroma_harm = librosa.feature.chroma_cqt(y=y, sr=sr)
chroma_filter = np.minimum(chroma_harm, librosa.decompose.nn_filter(chroma_harm, aggregate=np.median, metric='cosine'))
chroma_smooth = scipy.ndimage.median_filter(chroma_filter, size=(1, 9))
#Plot the graph
fig, ax = plt.subplots(nrows=2, sharex=True,sharey=True)
librosa.display.specshow(chroma_smooth, y_axis='chroma', x_axis='time', ax=ax[0])
ax[0].set(ylabel='Harmonics')
#write data to list. List has 12 seperate list for all 12 notes
#each one of these lists contains the strength per time (0 to 1)
times=chroma_smooth.tolist()
For example, can I still apply any filters here? Is there any solution?
I would be really grateful if someone could help me with this.
Thanks so much in advance
Sebastian