(start_times, z_instruments, t_instruments)
return z_notes
Get interpolated latent vectors for each note.
Get interpolated latent vectors for each note.
Get interpolated latent vectors for each note .
def get_z_notes(start_times, z_instruments, t_instruments):
  """Get interpolated latent vectors for each note."""
  z_notes = []
  for t in start_times:
    idx = np.searchsorted(t_instruments, t, side='left') - 1

    # Handles out of bounds errors.
    if idx.item() == t_instruments.size - 1:
      idx -= 1

    t_left = t_instruments[idx]
    t_right = t_instruments[idx + 1]
    interp = (t - t_left) / (t_right - t_left)
    z_notes.append(slerp(z_instruments[idx], z_instruments[idx + 1], interp))
  z_notes = np.vstack(z_notes)
  return z_notes
def get_z_notes ( start_times , z_instruments , t_instruments ) : z_notes = [ ] for t in start_times : idx = np . searchsorted ( t_instruments , t , side = 'left' ) - 1 # Handles out of bounds errors. if idx . item ( ) == t_instruments . size - 1 : idx -= 1 t_left = t_instruments [ idx ] t_right = t_instruments [ idx + 1 ] interp = ( t - t_left ) / ( t_right - t_left ) z_notes . append ( slerp ( z_instruments [ idx ] , z_instruments [ idx + 1 ] , interp ) ) z_notes = np . vstack ( z_notes ) return z_notes