Monday, May 12, 2008


new csound routine in python

This isn't tested yet so it probily doesn't work completely yet. this is the data needed to set up what is in some competing csound package (written in java) plus you can do some graphing with pie charts and other odd things that are probily useless but intertaining. Fushion charts for python was released as tw_fusioncharts (flash graphics) or somesuch and I wanted to test it out with this if it ever comes with instructions. The data and the code should always remain seperate so that it works with new graphics packages in python and even packages in c ( if the python shedskin compiler is ever up for it ) The spacing was killed by google

class instr_data:
begin_time = []
end_time = []

def csdInstrumentlist3(from_file):
"returns instr number and the start and stop time"
infile = open(from_file)
begin_time = []
end_time = []
bt = ''
et = ''
in = ''
cscore = 0
for line in infile:
if "" in line:
cscore = 1
if cscore == 1:
if line.startswith('i'):
x = line.split(' ')
iin = x[0]
x2 = iin.split(' ')
if in == '':
in = x[0]
if not in == x[0]:
in = x[0]
st = int(x2[0])
et = int(x2[1])

if x2[0] < bt =" x2[0]"> et:
et = x2[1]
return instr_data

Labels: ,

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?