Csound Csound-dev Csound-tekno Search About

[Csnd] vectorial opcodes bug?

Date2012-04-16 09:05
FromOeyvind Brandtsegg
Subject[Csnd] vectorial opcodes bug?
Hi

I wonder if there is something wrong with the vectorial opcodes, or if
I'm not using them correctly.

for example, I expected
		vadd_i	giOutput, 0.1, 0, giftlen
to add 0.1 to all elements of the table giOutput (with length giftlen)
but it seems nothing is happening to the table data.

Similar with other vectorial opcodes.
But vcopy_i seems to work fine.

Here's a short test csd, testing vadd_i, vmulti:i and vmultv_i

It seems also the k-rate versions of the opcodes (e.g. vadd for
vadd_i) similarly does not work.

best
Oeyvind






	sr = 44100
	ksmps = 100
	nchnls = 2	
	0dbfs = 1

	giftlen		= 16
	giPattern	ftgen	0, 0, giftlen, 2, 1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0		;
source pattern
	giTest		ftgen	0, 0, giftlen, -7, 0.2, giftlen, 0.2				; test
	giOutput	ftgen	0, 0, giftlen, 2, 0						; empty buffer

;*********************************************************************
; print
	instr	1
	ktest	tabsum giOutput			
	printk2	ktest
	endin

;*********************************************************************
; add
	instr	2
		vcopy_i	giOutput, giPattern, giftlen 	; copy data
		vadd_i	giOutput, 0.1, 0, giftlen
	endin

;*********************************************************************
; mult
	instr	3
		vcopy_i	giOutput, giPattern, giftlen 	; copy data
		vmult_i	giOutput, 0.1, 0, giftlen
	endin

;*********************************************************************
; vmult
	instr	4
		vcopy_i	giOutput, giPattern, giftlen 	; copy data
		vmultv_i giOutput, giTest, 0, giftlen
	endin


	
i1	0 	1		; expected 0.0, got 0.0
i2	1	1
i1	2 	1		; expected 5.6 (4+(16*0.1)), got 4.0
i3	3	1
i1	4 	1		; expexted 0.4, got 4.0
i4	5	1
i1	6 	1		; expected 0.8, got 4.0

e





-- 

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://flyndresang.no/
http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://soundcloud.com/t-emp