title: Determining pulses per quarter note
body: <p>I'm currently using <a href="http://www.kenschutte.com/midi" rel="nofollow">this code</a> (specifically the matrix2midi.m file) to write a MIDI file in Matlab. All is fine except that my tempo does not match what I specified.</p>
  
  <p>I currently have what I want the tempo to be in BPM. I then use the following formula to convert into a tempo format used by MIDI files (<a href="http://home.roadrunner.com/~jgglatt/tech/midifile/ppqn.htm" rel="nofollow">taken from</a>):
  Tempo = 60,000,000/BPM
  I then also have to set the pulses per quarter note (PPQN):
  PPQN = Tempo/TimeBase </p>
  
  <p>I've no idea what the time base refers to and how to get it.
  Is the PPQN something which is by the hardware?</p>