utils/pianoroll-format.py
author rougeronj
Thu, 22 Jan 2015 09:26:43 +0100
changeset 111 a7b72620d227
parent 0 e1d4d7a8255a
permissions -rw-r--r--
Add variable "wait". When this variable set, the annotsroll wait ignore some annotations, and wait before printing an otherone so there is no superposition. Can be passed as an options


import sys
import csv
import datetime
import time
import ntplib
from txosc import osc

if __name__ == '__main__':
    t0 = time.time()
    with open(sys.argv[1], 'rU') as datafile:
        reader = csv.reader(datafile, delimiter=' ')
        for row in reader:
            t1 = t0 + float(row[1])/10**3
            timetag = ntplib.system_to_ntp_time(t1)
            print " ".join([str(s) for s in [timetag, int(row[1]), 0] + [int(s) for s in row[2:4]]])