t_transport_state = -1, last_out_states = [-1, -1], last_time_str = "", 
    last_titles = [], last_flags = [], last_vols = [], last_pans = [],
    last_metronome = false, last_track_cnt = 0,
    g_inspect_tridx = -1;

var minvol = -100, maxvol = 24;

function setTextForObject(obj, text) { // thx cfillion
  if (obj.lastChild) obj.lastChild.nodeValue = text;
  else obj.appendChild(document.createTextNode(text));
}

function mouseDownEventHandler(msg) {
  return function(e) {
    if (typeof e == 'undefined') 