Compare commits

..

5 Commits

Author SHA1 Message Date
Lapin
6048fef636 feat: cover song identification via stream
I found a tuto with the streaming way to performe cover song identification.
I also add a way to download some sound with youtube dl.
to download musique now just type:

youtube-dl --config-location config_youtube-dl
2021-06-05 21:51:04 +02:00
Lapin
4f42ee4560 feat: CSI in strem mode (in progress) 2021-06-04 23:02:04 +02:00
Lapin
b0bf1edd7c todo improved
Juste some simple reflection about waht to do
2021-06-04 23:01:25 +02:00
Lapin
299e767d98 juste a file to note some thing... 2021-06-04 22:35:04 +02:00
Lapin
77c9e59767 feat: cover song identification exemple
I juste run the exemple with somme mp3 that i found.
Now i was juste too lasy to make a script that download the mp3.
Next time I'll do it, promise!

I had also to run the exemple in stream mode.

lot of nice thing to do :)
2021-06-04 22:29:55 +02:00
6 changed files with 39 additions and 8 deletions

View File

@ -18,19 +18,25 @@ import essentia.standard as estd
from essentia.pytools.spectral import hpcpgram from essentia.pytools.spectral import hpcpgram
import IPython import IPython
#IPython.display.Audio('./en_vogue+Funky_Divas+09-Yesterday.mp3')
#IPython.display.Audio('./beatles+1+11-Yesterday.mp3')
#IPython.display.Audio('./aerosmith+Live_Bootleg+06-Come_Together.mp3')
yesterday_original = 'audio/Yesterday (Remastered 2009).mp3' yesterday_original = 'audio/Yesterday (Remastered 2009).mp3'
yesterday_cover_01 = 'audio/Yesterday - The Beatles - Connie Talbot (Cover).mp3' yesterday_cover_01 = 'audio/Yesterday - The Beatles - Connie Talbot (Cover).mp3'
different_song = 'audio/Jacques Brel - Ne Me Quitte Pas.mp3' yesterday_cover_02 = 'audio/The Beatles - Yesterday Saxophone Cover Alexandra Ilieva Thomann.mp3'
different_song = 'audio/Bella Poarch - Build a Btch (Official Music Video).mp3'
IPython.display.Audio(yesterday_original) IPython.display.Audio(yesterday_original)
IPython.display.Audio(yesterday_cover_01) IPython.display.Audio(yesterday_cover_01)
IPython.display.Audio(yesterday_cover_02)
IPython.display.Audio(different_song) IPython.display.Audio(different_song)
# query cover song # query cover song
original_song = estd.MonoLoader(filename=yesterday_original, sampleRate=32000)() original_song = estd.MonoLoader(filename=yesterday_original, sampleRate=32000)()
true_cover_01 = estd.MonoLoader(filename=yesterday_cover_01, sampleRate=32000)() true_cover_01 = estd.MonoLoader(filename=yesterday_cover_01, sampleRate=32000)()
true_cover_02 = estd.MonoLoader(filename=yesterday_cover_02, sampleRate=32000)()
# wrong match # wrong match
false_cover_1 = estd.MonoLoader(filename=different_song, sampleRate=32000)() false_cover_1 = estd.MonoLoader(filename=different_song, sampleRate=32000)()
@ -40,6 +46,7 @@ false_cover_1 = estd.MonoLoader(filename=different_song, sampleRate=32000)()
query_hpcp = hpcpgram(original_song, sampleRate=32000) query_hpcp = hpcpgram(original_song, sampleRate=32000)
true_cover_hpcp_1 = hpcpgram(true_cover_01, sampleRate=32000) true_cover_hpcp_1 = hpcpgram(true_cover_01, sampleRate=32000)
true_cover_hpcp_2 = hpcpgram(true_cover_02, sampleRate=32000)
false_cover_hpcp = hpcpgram(false_cover_1, sampleRate=32000) false_cover_hpcp = hpcpgram(false_cover_1, sampleRate=32000)
@ -77,6 +84,15 @@ plt.ylabel('Yesterday - The Beatles')
plt.imshow(true_pair_crp_1, origin='lower') plt.imshow(true_pair_crp_1, origin='lower')
true_pair_crp_2 = crp(query_hpcp, true_cover_hpcp_2)
fig = plt.gcf()
fig.set_size_inches(15.5, 5.5)
plt.title('Cross recurrent plot [1]')
plt.xlabel('Yesterday accapella cover')
plt.ylabel('Yesterday - The Beatles')
plt.imshow(true_pair_crp_2, origin='lower')
@ -138,6 +154,23 @@ plt.imshow(score_matrix, origin='lower')
print('Cover song similarity distance: %s' % distance) print('Cover song similarity distance: %s' % distance)
## other similar
score_matrix, distance = estd.CoverSongSimilarity(disOnset=0.5,
disExtension=0.5,
alignmentType='serra09',
distanceType='asymmetric')(true_pair_crp_2)
fig = plt.gcf()
fig.set_size_inches(15.5, 5.5)
plt.title('Cover song similarity distance: %s' % distance)
plt.xlabel('Yesterday accapella cover')
plt.ylabel('Yesterday - The Beatles')
plt.imshow(score_matrix, origin='lower')
print('Cover song similarity distance: %s' % distance)
## Computing cover song similarity distance between Yesterday - accapella cover and Come Together cover - The Aerosmith. ## Computing cover song similarity distance between Yesterday - accapella cover and Come Together cover - The Aerosmith.
score_matrix, distance = estd.CoverSongSimilarity(disOnset=0.5, score_matrix, distance = estd.CoverSongSimilarity(disOnset=0.5,

View File

@ -10,10 +10,9 @@ from essentia.pytools.spectral import hpcpgram
yesterday_original = 'audio/Yesterday (Remastered 2009).mp3' yesterday_original = 'audio/Yesterday (Remastered 2009).mp3'
yesterday_cover_01 = 'audio/Yesterday - The Beatles - Connie Talbot (Cover).mp3' yesterday_cover_01 = 'audio/Yesterday - The Beatles - Connie Talbot (Cover).mp3'
wrong_song = 'audio/Jacques Brel - Ne Me Quitte Pas.mp3' wrong_song = 'audio/Bella Poarch - Build a Btch (Official Music Video).mp3'
song_reference = yesterday_original # the original song analysed in normal mode song_reference = yesterday_original
song_streaming = wrong_song # the song get in stream mode to compare to reference
# query cover song # query cover song
original_song = estd.MonoLoader(filename=song_reference, sampleRate=32000)() original_song = estd.MonoLoader(filename=song_reference, sampleRate=32000)()
@ -28,10 +27,11 @@ true_cover_hpcp = hpcpgram(original_song, sampleRate=32000)
import essentia.streaming as estr import essentia.streaming as estr
from essentia import array, run, Pool from essentia import array, run, Pool
query_filename = wrong_song
# Let's instantiate all the required essentia streaming algorithms # Let's instantiate all the required essentia streaming algorithms
audio = estr.MonoLoader(filename=song_streaming, sampleRate=32000) audio = estr.MonoLoader(filename=query_filename, sampleRate=32000)
frame_cutter = estr.FrameCutter(frameSize=4096, hopSize=2048) frame_cutter = estr.FrameCutter(frameSize=4096, hopSize=2048)

View File

@ -1,2 +0,0 @@
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch "*.mp3"' --prune-empty --tag-name-filter cat -- --all

2
todo
View File

@ -48,7 +48,7 @@ Ce qu'il reste a faire:
* avoir un input type micro * avoir un input type micro
* avoir une entree avec jack (jackd) * avoir une entree avec jack (jackd)
* Faire tourner plusieur processus pour pouvoir annalyser plusieurs track en meme temps. * Faire tourner plusieur processus pour pouvoir annalyser plusieurs track en meme temps.
* ET VOILA CA DEVRAIT ETRE BON =) *
1) un scritp qui telecharge les son: 1) un scritp qui telecharge les son: