Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the difference between "filename" and "name_file"? #1

Open
niklas1102 opened this issue Jan 24, 2021 · 6 comments
Open

What is the difference between "filename" and "name_file"? #1

niklas1102 opened this issue Jan 24, 2021 · 6 comments

Comments

@niklas1102
Copy link

Is there a difference between "filename" and "name_file"? For example, if I want to use
get_harmonic_change(filename: str, name_file: str, hpss: bool = False, tonal_model: str = 'TIV2', chroma: str = 'cqt', blur: str = 'full', sigma: int = 11, log_compresion: str = 'none', dist: str = 'euclidean')
What is the "name_fiele" here?
There is an explanation, but I didn't quite understand it. Can anyone explain this to me?
Thanks in advance

@PRamoneda
Copy link
Owner

Hi there!! @Androidismyhobby

Thank you for using my code! (It was part of my bachelor thesis last year)

Just out of curiosity, what are you going to use it for? :D

if your file to compute is ´please_please_me.wav´. Then, filename='please_please_me.wav' and name_file='please_please_me´.

filename is the name of the file to be processed. And name_file is the name of the files that are generated to reduce computational cost. The reality is that this code was part of a larger distributed system and namefile was not the same as filename. But you are right that the naming doesn't help to understand. I can change it to in_file, out_file hahahaha

Have you installed the vamp plugins? (to make nnls work)

Have you read the paper?

Thank you so much!

@niklas1102
Copy link
Author

Hi, @PRamoneda ,
Thank you for the quick and good explanation.
I recently came across your library and it really is the only good HCDF library out there that I could find. Thank you very much for publishing it on Github and I'm glad I came across it. At the moment I'm still trying things out a bit and I just wanted to see what one can do with it, because I'm interested in music and computer science and also currently study this. I have already installed the vamp plugins, but I haven't read the paper yet, but I definitely plan to do so ;-)

Again: Great library and really a stroke of luck for me. And thanks again for the explanation :-)

@PRamoneda
Copy link
Owner

PRamoneda commented Jan 24, 2021

Hi, @Androidismyhobby

Thanks for your kind words :)

My background is also in computer science and music (piano performance). Currently, I am studying this master: https://www.upf.edu/web/smc.

There are a lot of opportunities in this field. I also recommend you this library if you are interested in building models from data: https://github.com/mir-dataset-loaders/mirdata (I am collaborating in the development too xd)

What university are you from?

@niklas1102
Copy link
Author

Hi, @PRamoneda ,
Funnily enough, I study almost the same thing as you in the UK (https://www.gold.ac.uk/ug/bmus-bsc-electronic-music-computing/), even if I'm originally from Germany. I'm only here in the first semester, but for me it really is the most exciting subject that you can study. But I still have a few years ahead of me xd.

Thank you very much for the tip from your library. I will definitely take a look at it. Sounds very exciting and is exactly my "taste" ;-)
I was really surprised at first when I was looking for such modules because I found almost nothing, but apparently there are quite a few ...

Can I ask you one more thing about using your HCDF library? I'm sorry, I hope I don't annoy you with this:
Am I using this correctly: HCDF.harmonic_change ("please_please_me", "please_please_me.wav", False, "TIV2", "cqt", "full", 11, "none", "euclidean")
But unfortunately I always a list-index-error:

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\Kinder\Downloads\HCDF-master\HCDF-master\HCDF.py", line 685, in harmonic_change check_parameters(chroma, blur, tonal_model, log_compresion, distance) File "C:\Users\Kinder\Downloads\HCDF-master\HCDF-master\HCDF.py", line 206, in check_parameters chroma = get_parameters_chroma(chroma)["chroma"] File "C:\Users\Kinder\Downloads\HCDF-master\HCDF-master\HCDF.py", line 173, in get_parameters_chroma return {"chroma": rows[0], "sr": int(rows[1]), "fr": int(rows[2]), "off": int(rows[2]) // int(rows[3])} IndexError: list index out of range

Did I make any mistake with the input? As I said, I'm still trying a bit and I'm not very experienced with such modules so I hope I haven't made some stupid mistake ;-)

@PRamoneda
Copy link
Owner

PRamoneda commented Jan 24, 2021

I hope I don't annoy you with this:

I am always asking to everybody! Don't worry!

Ok, try to download other time the library! I have removed some little problems I generated when I extracted this part of code from the whole system.
BTW, filename is the file path from the python code:
'./audio_files/07_-Please_Please_Me.wav'
and name_file only the name without the extension '07
-_Please_Please_Me'

if I execute this code:

if __name__ == '__main__':
    onset, hcdf, winows_size = harmonic_change('./audio_files/07_-_Please_Please_Me.wav',
                                               '07_-_Please_Please_Me',
                                               chroma='stft-44100-2048-4',
                                               hpss=True,
                                               tonal_model='TIV2',
                                               blur='full',
                                               sigma=17,
                                               distance='euclidean')

    print("chord changes", onset)

the screen output is:

changes of chord [  0.           0.41795833   0.87074653   1.28870486   2.03174189
   2.54257985   3.1579074    3.59908564   4.23763309   4.69042128
   5.39862846   5.97912614   6.59445368   7.07046178   8.17340738
   8.57975576   8.92805437   9.14864349   9.45050229   9.84524071
  10.26319904  10.79725691  11.15716547  11.50546408  11.81893283
  12.10918168  12.31816084  12.60840968  13.03797797  13.98999417
  14.82591083  15.25547912  15.71987727  15.96368629  16.26554509
  16.68350342  17.17112147  17.53103004  18.09991777  18.59914578
  19.00549415  19.50472216  19.99234022  20.56122795  21.03723605
  21.45519438  21.93120248  22.44204044  23.12702771  23.74235525
  24.3809027   24.88013071  25.42579853  26.4358645   26.98153232
  27.6897395   28.29345709  28.94361449  29.47767236  30.10460986
  30.74315731  31.31204504  32.10152189  32.94904851  33.45988647
  33.94750452  34.37707281  35.1317198   35.57289804  36.47847442
  36.90804271  37.82522905  38.52182627  39.42740266  39.79892117
  40.06595011  40.49551839  40.92508668  41.44753459  42.35311098
  42.80589917  43.23546746  43.73469547  44.18748366  44.61705195
  45.04662023  45.8825369   46.30049523  46.74167347  47.41505078
  47.85622902  48.19291768  48.5876561   49.00561443  49.58611212
  50.10856003  50.75871744  51.19989568  51.85005308  52.56987021
  52.88333896  53.99789451  54.46229266  55.86709705  56.55208432
  57.12097205  57.77112945  58.386457    58.82763524  59.31525329
  60.4646387   60.97547666  61.55597435  62.63570004  63.06526832
  63.44839679  63.99406462  64.92286091  65.73555767  66.24639563
  66.8036734   67.45383081  68.28974747  68.74253567  69.19532386
  70.01963057  70.36792918  71.37799515  71.93527293  72.39967107
  72.88728913  73.46778681  74.46624283  74.97708079  75.81299745
  76.39349513  76.927553    77.94922893  78.43684698  79.00573471
  79.42369304  80.0854604   80.57307845  81.0374766   81.65280415
  81.9662729   82.39584118  82.81379951  83.28980761  83.64971618
  84.05606456  84.42758307  84.72944187  85.28671964  85.90204719
  86.23873584  86.65669418  87.12109232  87.87573931  88.34013746
  88.59555644  88.88580528  89.30376361  90.0584106   90.46475898
  90.97559694  91.39355527  92.04371268  92.69387008  93.216318
  93.66910619  94.14511429  94.56307262  95.31771961  95.80533767
  96.45549507  97.04760271  97.6513203   98.01122886  98.28986775
  99.06773465  99.60179252 100.39126937 101.02981682 101.78446381
 102.33013163 102.93384922 103.46790709 103.93230523 104.57085269
 105.31388972 105.8711675  106.30073578 106.78835384 107.20631217
 108.00739897 108.79687582 109.84177165 110.34099966 110.77056795
 111.15369642 111.66453438 112.3611316  112.81391979 113.33636771
 113.75432604 114.14906446 114.57863275 115.08947071 115.66996839
 116.1691964  116.65681445 117.38824154 117.93390936 118.17771839
 118.50279709 118.8510957  119.51286306 120.74351815 120.81317787]

@niklas1102
Copy link
Author

Perfect. It works. Thank you very much for your efforts and your support.
I have to say, I'm pretty excited that it works :-) Now I'll have a fun time trying it out.

Thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants