The Zizula Forum

Computers => Digital Signal Processing => Topic started by: edexter on June 08, 2011, 09:01:23 PM



Title: python csound vst generator. hard codes all the paremeters into the csound inst
Post by: edexter on June 08, 2011, 09:01:23 PM
import sys

#this is an attempt to auto-generate a csound vst instrument all as one instrument
#This is run after the initial dump and would not have to be run later.
#this is a first draft as all one command line.  You may have to play with the path
#the files are in to get it to work it is beta.  Requires the name of all the
#vst paremters to be in a file on one line.

#infile = open('dump.txt','r')
infile = open(sys.argv[1][:-3] + 'spr','r')
orcoutfile = open(sys.argv[1][:-3] + 'orc','w')

orcoutfile.write("instr 1\n")
orcoutfile.write('vstinit ')
orcoutfile.write(sys.argv[1])
orcoutfile.write("\n")
orcoutfile.write("imidichannel init 0\n")
orcoutfile.write("vstnote gigpianoteq, imidichannel, p4, p5, p3\n")
#outfile
#print line
p = 0
for line in infile:
    #print line
    n = line.split()
    #print n
    for roun in n:
    #for n in line.split():
    #if line.startswith('  Parameter'):
        #par = line.split(': ')
        p = p + 1
        orcoutfile.write("vstparamset gipianoteq, ")
        orcoutfile.write(str(p))
        orcoutfile.write(', p')
        orcoutfile.write(str(p + 5))
        orcoutfile.write('\n')
        #out_par = par[1][:-2]
        #out_par = out_par.replace(' ','_')
        #outfile.write(out_par)
        #outfile.write(' ')
orcoutfile.write("""ablankinput     init            0
aleft, aright   vstaudio        gipianoteq, ablankinput, ablankinput
                outs            aleft, aright
                endin""")


   


Title: Re: python csound vst generator. hard codes all the paremeters into the csound inst
Post by: edexter on June 08, 2011, 09:04:33 PM
This is beta and the manual shows that vst instruments are done as two instruments.  I haven't tried to get sound of it yet.  The plan is to make this current series part of the ifn tools collection of command line utilities.  I tested this on 2.6 should work on just about any version of python.  would be glad to know how it works for you if you want to post.