<jupyter_start><jupyter_text>Load Metadata<jupyter_code>df_meta = pd.read_csv('./data/fma_metadata/tracks.csv', header=None)
def combine_list(list_1, list_2):
    l=[]
    for i in range(len(list_1)):
        l.append(list_1[i] + '_' + list_2[i])
    return(l)
        
columns = ['track_id'] + combine_list(df_meta.iloc[0,1:].values, df_meta.iloc[1,1:].values)
df_meta = df_meta.iloc[3:,:]
df_meta.columns = columns
df_meta.head()
df_meta.columns<jupyter_output><empty_output><jupyter_text>Split train and validation And choose genre(eventually?)<jupyter_code>df_meta_small = df_meta[df_meta.set_subset == 'small']
np.unique(df_meta_small.track_genre_top)
genre = 'Rock'
df_meta_small.sample()<jupyter_output><empty_output><jupyter_text>Check properties of file<jupyter_code>import scipy
from scipy.signal import stft
import matplotlib.pyplot as plt
from crystal_clear.metadata import small_meta
from crystal_clear.prepare import open_random_file
song = open_random_file(small_meta())

samples = np.array(song.get_array_of_samples()).reshape(song.channels, -1, order='F')
sample_rate = song.frame_rate

sample_rate, samples.shape
f, t, Zxx = scipy.signal.stft(samples, sample_rate)

plt.pcolormesh(t[:129], f, np.abs(Zxx)[0,:,:129], vmin=0)
plt.title('STFT Magnitude')
plt.ylabel('Frequency [Hz]')
plt.xlabel('Time [sec]')
plt.show()
len(np.abs(Zxx).shape)
from crystal_clear.prepare import *
data = np.abs(Zxx)
data.shape
data_3D = make_into_3D(data)
np.pad(data_3D[:, :, :100], ((0,0), (0,0) , (0, 29)), mode='constant').shape
make_3D_into_square(data_3D)[0][0].shape<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15625, 'fraction_numerical': 0.0225, 'mean_word_length': 7.085858585858586, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '332334', 'license': 'Apache-2.0', 'n_tokens_mistral': 660, 'n_tokens_neox': 641, 'n_words': 100, 'path': 'Experiments.ipynb', 'repo_name': 'StatisticDean/Crystal_Clear', 'size': '1600'}