#!/usr/bin/env python

import csnd, os

tempfile = open('tempinputchuckk.sco', 'w')

sco = '''
#define TEST(t) #
i1 [$t+0] 1
i1 [$t+1] 1
i1 [$t+2.5] 1
#

$TEST(0)
$TEST(4)
$TEST(8)
'''

tempfile.write(sco)
tempfile.close()

infile = open('tempinputchuckk.sco', 'r')

outfile = open('tempoutputchuckk.sco', 'w')

print
print '###infile type: ',  infile.__class__.__name__
print
print '###outfile type: ', outfile.__class__.__name__
print
print "Sorting Csound Score..."
print

cs = csnd.CppSound()
cs.PreCompile()
cs.ScoreSort(infile, outfile)
