urinieto / harmonixset

The Harmonix Set: Beats, Downbeats, and Structural Annotations for Pop Music
MIT License
149 stars 24 forks source link

The mel spectrogram #12

Closed stg1205 closed 2 years ago

stg1205 commented 2 years ago

Hello,

Why does the pre-calculated mel spectrogram just have one dimension?

urinieto commented 2 years ago

It should be 2-dimensional. What URL did you use to get these data?

stg1205 commented 2 years ago

I used the dropbox link in your readme.

urinieto commented 2 years ago

I just downloaded the file from the link in the readme (https://www.dropbox.com/s/zxnqlx0hxz0lsyc/Harmonix_melspecs.tgz?dl=0) and the melspecs are 2-dimensional:

In [1]: import numpy as np
In [2]: np.load("/Users/onieto/Downloads/Harmonix_melspecs/melspecs/0001_12step-mel.npy").shape
Out[2]: (80, 3066)

Maybe your downloading process did not properly finish?

stg1205 commented 2 years ago

Oh I see. I used np.fromfile to load the data. It's weired that it's one-dimension and also the length is not an integar multiple of n_mels. np.load works well. Thank you for your help!

urinieto commented 2 years ago

Yeah, it is not advised to use fromfile to read in platform independent npy files (see note here: https://numpy.org/doc/stable/reference/generated/numpy.fromfile.html).

I'll close this for now.