code: 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
  
file_path: magenta/magenta/models/gansynth/lib/generate_util.py
imports: from magenta.models.gansynth.lib import util
  import note_seq
  import numpy
  from scipy.io import wavfile
label_desc: Use image node_id 4 for calling a global function with example usage: get_z_notes(start_times, z_instruments, t_instruments) and returns: z_notes