code: def get_active_frame_indices(piano_roll):
      """Create matrix of frame indices for active notes relative to onset."""
      active_frame_indices = np.zeros_like(piano_roll)
      for frame_i in range(1, active_frame_indices.shape[0]):
          prev_indices = active_frame_indices[frame_i - 1, :]
          active_notes = piano_roll[frame_i, :]
          active_frame_indices[frame_i, :] = (
              prev_indices + 1
          ) * active_notes
      return active_frame_indices
  
file_path: ddsp/ddsp/training/heuristics.py
imports: import ddsp
  import gin
  import note_seq
  import numpy
  import tensorflow.compat.v2
label_desc: Use image node_id 1 for calling a global function with example usage: get_active_frame_indices(piano_roll) and returns: active_frame_indices