Csound Csound-dev Csound-tekno Search About

[Cs-dev] New arguments for vectorial opcodes

Date2006-06-07 17:32
FromAndres Cabrera
Subject[Cs-dev] New arguments for vectorial opcodes
Hi all,
I've committed an initial change to the vectorial opcodes as test for an
idea I have of adding vector offsets to these opcodes, so that vectors
need not start and be copied (or any other vectorial operation) from the
start of tables, but from any to any point. I see great use for this for
instance when working with tables drawn from spectral analysis to cut,
multiply, exchange, etc. sections of spectra.
I wanted to announce this small change in case I'm doing something
unsafe, or if it can be done better, before I start hacking away at all
the other vectorial opcodes.
The arguments added are optional, and if not present, the opcode
defaults to its original behavior.
The opcode that now accepts two additional optional arguments, is
vcopy_i.
Here's an example:




sr=44100
ksmps=1
nchnls=2

	instr 1	;copy
ifn1 = p4
ifn2 = p5
ielements = p6
idstoffset = p7
isrcoffset = p8


vcopy_i ifn1, ifn2, ielements, idstoffset, isrcoffset

	endin

	instr 2	;Printtable
itable = p4

isize = ftlen(itable)
kcount init 0


kval table kcount, itable

printk2 kval

if (kcount == isize) then
  turnoff
endif

kcount = kcount + 1 
	endin





f 1 0 32 -7 1 31 32

f 2 0 32 -7 1 31 32

i2	0.0	1	1
			;fn1	fn2	elem	dstoff	srcoff	
i1	2.0	1	1	2	5	3	5	
i2	4.0	1	1	
e







_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net