Monday, July 16, 2007

 
A new version of csound routines is out includes an autoit script and some popen code to run awk programs. Also included is a script to control gvim It is a working version of loading an orc into a csd. https://sourceforge.net/project/showfiles.php?group_id=156455&package_id=202823 The code that is required to control gvim is listed below

from win32com.client.dynamic import Dispatch

def load_instrument_vim(csdfile, orcfile, tagname):
csdfile2 = re.sub(r"\\",r"/",csdfile) #replace \ with /
orcfile2 = re.sub(r"\\",r"/",orcfile) #re[lace \ with /
vim = Dispatch('Vim.Application')
os.path = 'c:\dex_tracker'
vim.SendKeys(':e '+ csdfile + '')
vim.SendKeys('/' + tagname + '')
vim.SendKeys('/;')
vim.SendKeys(':r ' + orcfile2 +'')
vim.SendKeys(':w')

It should reqire pywin. This is a much better example of the ole com control than is listed on the gvim website and it is very easy to write scripts for

Labels: , , , ,


Monday, June 18, 2007

 

csound 5.06, csound routines in awk, csound routines python

csound 5.06 has been released. Looks like there is just a small amount of traffic. I have recently descovered the awk language and it appears that small programs can be written very rapidly with it.. Here is a couple of awk programs for csound that show how small these programs are. (I would figure there is alot of these programs somewhere but not released)

This one changes the start time throughout an entire file

#usages time_offset outfile
#this is the example command line
#gawk -f altertime.awk -v time_offset=4 -v outfile="testdat.sco" i1.sco
{$2 = $2 + time_offset}
{ print $0 > outfile } # print every line

This one changes the instrument number


#usages old_number new_number outfile
#this is the example command line
#gawk -f instrnumber.awk -v old_number=30 -v new_number=1 -v outfile="testdat.orc" temp30.orc
$1 == "instr" && $2 == old_number {
$2 = new_number
}
{ print $0 > outfile } # print every line

there is a couple of new python routines in csound routines available here.

http://sourceforge.net/projects/dex-tracker/

trafic overall looks like it has dropped off.. posibly something to do with school being out.

Labels: , , ,


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