code: def bpm2tempo(bpm, time_signature=DEFAULT_TIME_SIGNATURE):
      """
      Convert BPM (beats per minute) to MIDI file tempo (microseconds per
      quarter note).
  
      Depending on the chosen time signature a bar contains a different number of
      beats. These beats are multiples/fractions of a quarter note, thus the
      returned BPM depend on the time signature.
  
      """
      return int(round(60 * 1e6 / bpm * time_signature[1] / 4.0))
  
imports: from __future__ import absolute_import, division, print_function
  import warnings
  import mido
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: bpm2tempo(bpm, time_signature) and returns: int