# Scanu2 negative id

**URL:** <https://forum.csound.com/t/scanu2-negative-id/2505>\
**Category:** General\
**Created:** [June 19, 2026, 4:37pm UTC](https://forum.csound.com/t/scanu2-negative-id/2505 "2026-06-19T16:37:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![piripero013](https://forum.csound.com/user_avatar/forum.csound.com/piripero013/32/186_2.png) [@piripero013](https://forum.csound.com/u/piripero013)\
**Post date:** [June 19, 2026, 4:37pm UTC](https://forum.csound.com/t/scanu2-negative-id/2505/1 "2026-06-19T16:37:11Z")

</div>

Hello everyone,  
I was experimenting with scanned synthesis and I don’t understand an error I am getting. This is the code:

```csound

 <CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>

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

		
		//tables for the hammer
		giSine = ftgen(334, 0, 128, 10, 1)

		//scanu tables - initialisation
		giVel = ftgen(0, 0, 128, -7, .01, 128, .01)
		giMass = ftgen(0, 0, 128, -7, 1, 128, 1)
		giStiff = ftgen(201,0,16384,-23,"128-stringcircular")
		;giStiff = ftgen(201,0,16384,-23,"circularstring-128")
		giCentr = ftgen(0, 0, 128, -7, .5, 128, .5) ;mantained at 1, then scaled within the instr
		giDamp = ftgen(0, 0, 128, -7, 1, 128, 1)

		//trajectory tables
		giTraj1 = ftgen(0, 0, 128, -7, 0, 128, 64)
		giTraj2 = ftgen(0,0,128,-7, 64, 64, 0,64,127)
		giSpiralTraj = ftgen(0,0,128,-23,"spiral-8,16,128,2,1over2.txt")
		giLeftRight = ftgen(0,0,128,-23,"128-left_rightX")
		
		//recording table
		giWave = ftgen(666,0,128,-2,0)
		
		
instr SkannedWave
	irate = .01
	kmass = 3
	kstiff = 2
	kcentr = .1
	kdamp = -.05
	ileft = .8
	iright = .1
	kpos = .35
	kstrngth = 1
	idisp = 0
	id = -666
	aIn = 0

	scanu2(giSine,irate,giVel,giMass,giStiff,giCentr,giDamp,kmass,kstiff,kcentr,kdamp,
				ileft,iright,kpos,kstrngth,aIn,idisp,id)
	
	aSig = poscil(.5,p4,666)
	prints "yesss\n\n"
	
		outs(aSig,aSig)

endin

</CsInstruments>
<CsScore>
i "SkannedWave"	0 20 110

```

The error I have is:

> Invalid ftable no. -666.000000  
> INIT ERROR in instr 1 (opcode scanu2) line 48: scanu: invalid id table  
> from file C:\Users\Bubi.LAPTOP-6UV3ABKT\Documents\Matteo\Csound\skanna\skndWave.csd (1)  
> scanu2 giSine irate giVel giMass giStiff giCentr giDamp kmass kstiff kcentr kdamp ileft iright kpos kstrngth aIn idisp id   
> B 0.000 - note deleted. i1 (SkannedWave) had 0 init errors  
> end of Performance

But as I read in the manual, a negative ID should not be an error, as when it is negative, its absolute value correspond to the number of the ftable where the waveform is to be written.  
The “scanu2” page of the manual states:

> id – If positive, the ID of the opcode. This will be used to point the scanning opcode to the proper waveform maker. If this value is negative, the absolute of this value is the wavetable on which to write the waveshape. That wavetable can be used later from an other opcode to generate sound. The initial contents of this table will be destroyed.

Does anyone have an idea about why I get this error?

Thanks in advance,

_Matteo_

---

<div class="post-metadata">

**Author:** ![hlolli](https://forum.csound.com/user_avatar/forum.csound.com/hlolli/32/3_2.png) [@hlolli](https://forum.csound.com/u/hlolli)\
**Post date:** [July 8, 2026, 12:23pm UTC](https://forum.csound.com/t/scanu2-negative-id/2505/2 "2026-07-08T12:23:08Z")

</div>

> [@piripero013](#):
>
> `giWave = ftgen(666,0,128,-2,0)`

you don’t have to give it a number if you just use 0, then refer to the table number by referring to the variable giWave. Did you maybe solve this since you posted this?

---

<div class="post-metadata">

**Author:** ![piripero013](https://forum.csound.com/user_avatar/forum.csound.com/piripero013/32/186_2.png) [@piripero013](https://forum.csound.com/u/piripero013)\
**Post date:** [September 30, 2026, 3:20pm UTC](https://forum.csound.com/t/scanu2-negative-id/2505/3 "2026-09-30T15:20:35Z")

</div>

Even tho I try to put -giWave, with the predefined table ID, it still give me the same error

---

<div class="post-metadata">

**Author:** ![hlolli](https://forum.csound.com/user_avatar/forum.csound.com/hlolli/32/3_2.png) [@hlolli](https://forum.csound.com/u/hlolli)\
**Post date:** [September 30, 2026, 4:02pm UTC](https://forum.csound.com/t/scanu2-negative-id/2505/4 "2026-09-30T16:02:19Z")

</div>

turns out your bug has been fixed on develop earlier this month with this PR [fix(scansyn): isolate force windows and restore table output by hlolli · Pull Request #3091 · csound/csound · GitHub](https://github.com/csound/csound/pull/3091) either build yourself if you can, or wait for next release. So you’re right, it was an issue.

---

<div class="post-metadata">

**Author:** ![piripero013](https://forum.csound.com/user_avatar/forum.csound.com/piripero013/32/186_2.png) [@piripero013](https://forum.csound.com/u/piripero013)\
**Post date:** [October 1, 2026, 5:33pm UTC](https://forum.csound.com/t/scanu2-negative-id/2505/5 "2026-10-01T17:33:50Z")

</div>

wow, tank you very much for your effort! I would try to fix the opcode myself but, unfortunately, I have no such IT skills… for now

again, thanks a lot!
