Targeted TD-PSOLA fails
bozothegrey opened this issue · 1 comments
Hello, I am trying to follow step by the step of the tutorial. My input is a single channel audio file.
Small edit to the tutorial:
I assume it should be
x_3keydown = tsm.tdpsola(x, sr, src_f0=f0_crepe, **tgt_f0**=f0_crepe * pow(2, -3/12), p_hop_size=441, p_win_size=1470)
and not target_f0.
The issue is that
tsm.tdpsola(x, sr, src_f0=f0_crepe, tgt_f0=f0_crepe * pow(2, -3/12), p_hop_size=441, p_win_size=1470)
fails with this error.
Is it because the input is single channel ?
`---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
in
1 target = f0_crepe * pow(2, -3/12)
----> 2 x_3keydown = tsm.tdpsola(x.T, sr, src_f0=f0_crepe, tgt_f0=target, p_hop_size=441, p_win_size=1470)
c:\users\stefano\appdata\local\programs\python\python37\lib\site-packages\pytsmod\tdpsolatsm.py in tdpsola(x, sr, src_f0, tgt_f0, alpha, beta, win_type, p_hop_size, p_win_size)
64 tgt_f0_chan = tgt_f0[c]
65 beta_seq = _target_f0_to_beta(x_chan, pm_chan,
---> 66 src_f0_chan, tgt_f0_chan)
67 else:
68 beta_seq = np.ones(pitch_period.size) * beta
c:\users\stefano\appdata\local\programs\python\python37\lib\site-packages\pytsmod\tdpsolatsm.py in _target_f0_to_beta(x, pitch_mark, source_f0, target_f0)
148 idx = source_f0.size - 1
149
--> 150 if (not target_f0[idx] == 0) and (not source_f0[idx] == 0):
151 beta[i] = target_f0[idx] / source_f0[idx]
152 else:
IndexError: only integers, slices (:
), ellipsis (...
), numpy.newaxis (None
) and integer or boolean arrays are valid indices
`
Let me investigate a bit more. I will revert if still an issue.