code: def window_array(array, sr, win_len, frame_step_ratio=0.75, ax=0):
      """Chop up an array into overlapping frame windows."""
      frame_length = int(sr * win_len)
      frame_step = int(sr * win_len * frame_step_ratio)
      pad_front = int(sr * win_len * (1 - frame_step_ratio))
  
      padded_a = np.concatenate(
          [np.zeros_like(array)[:pad_front], array], axis=ax
      )
      return tf.signal.frame(
          padded_a,
          frame_length=frame_length,
          frame_step=frame_step,
          pad_end=True,
          axis=ax,
      ).numpy()
  
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 4 for calling a global function with example usage: window_array(array, sr, win_len, frame_step_ratio, ax) and returns: tf