Skip to content

Commit

Permalink
quick and dirty changes for Yigit to review
Browse files Browse the repository at this point in the history
  • Loading branch information
dmr-songquito committed Jul 11, 2024
1 parent 1d9bda0 commit 1979983
Show file tree
Hide file tree
Showing 18 changed files with 356 additions and 79 deletions.
Binary file added data/hihat/funky001.wav
Binary file not shown.
Binary file added data/hihat/pitched006.wav
Binary file not shown.
Binary file added data/hihat/pres_002.wav
Binary file not shown.
Binary file added data/hihat/sabian_003.wav
Binary file not shown.
Binary file added data/hihat/tama_036.wav
Binary file not shown.
Binary file added data/kick/electro008.wav
Binary file not shown.
Binary file added data/kick/pitched005.wav
Binary file not shown.
Binary file added data/kick/rock005.wav
Binary file not shown.
Binary file added data/kick/rock007.wav
Binary file not shown.
Binary file added data/kick/sput001.wav
Binary file not shown.
Binary file added data/snare/cheeba_002.wav
Binary file not shown.
Binary file added data/snare/metal0010.wav
Binary file not shown.
Binary file added data/snare/princes003.wav
Binary file not shown.
Binary file added data/snare/rock018.wav
Binary file not shown.
Binary file added data/snare/sonor_034.wav
Binary file not shown.
102 changes: 72 additions & 30 deletions demo_audio_mosaicing_continuity.ipynb

Large diffs are not rendered by default.

319 changes: 276 additions & 43 deletions demo_drum_sound_separation_nmf.ipynb

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions libnmfd/utils/core_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ def visualize_components_nmf(V: np.ndarray,
freq_axis = np.arange(num_log_bins)

# subsample freq axis
sub_samp = np.where(np.mod(log_freq_axis.astype(np.float32), 55) < 0.001)[0]
sub_samp_freq_axis = log_freq_axis[np.mod(log_freq_axis.astype(np.float32), 55) < 0.001]
sub_samp = np.where(np.mod(log_freq_axis.astype(float), 55.0) < 0.001)[0]
sub_samp_freq_axis = log_freq_axis[np.mod(log_freq_axis.astype(float), 55.0) < 0.001]

font = {'family': 'sans-serif',
'weight': 'normal',
Expand Down Expand Up @@ -413,6 +413,8 @@ def visualize_components_nmf(V: np.ndarray,

norm_W *= 1 / (EPS + norm_W.max(axis=0))

print(sub_samp_freq_axis.shape)

ax3.imshow(norm_W, aspect='auto', cmap='gray_r', origin='lower',
extent=[0, (R*num_template_frames)-1, sub_samp_freq_axis[0], sub_samp_freq_axis[-1]])
ax3.set_xticks([0, R*num_template_frames])
Expand Down Expand Up @@ -460,10 +462,10 @@ def visualize_components_nmf(V: np.ndarray,

def __set_comp_vol_vec(R):
if R == 2:
return np.array([[1, 0, 0], [0, 0.5, 0.5]], dtype=np.float)
return np.array([[1, 0, 0], [0, 0.5, 0.5]], dtype=float)
elif R == 3:
return np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]], dtype=np.float)
return np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]], dtype=float)
elif R == 4:
return np.array([[1, 0, 1], [1, 0.5, 0], [0, 1, 0], [0, 0.5, 1]], dtype=np.float)
return np.array([[1, 0, 1], [1, 0.5, 0], [0, 1, 0], [0, 0.5, 1]], dtype=float)
else:
return np.tile(np.array([0.5, 0.5, 0.5]), (R, 1)).astype(np.float)
return np.tile(np.array([0.5, 0.5, 0.5]), (R, 1)).astype(float)

0 comments on commit 1979983

Please sign in to comment.