Csound Csound-dev Csound-tekno Search About

[CSOUND-DEV:5329] ftgen and user-defined opcodes

Date2004-09-18 01:01
Fromsteven yi
Subject[CSOUND-DEV:5329] ftgen and user-defined opcodes
Attachmentsftgen_udo_good.csd  ftgen_udo_bad.csd  
Hi all,

I think I've found a bug, or at least, am confused and need some 
clarification.  =)  I was writing a user-defined opcode today and had 
placed it in the instr 0 space of a CSD file.  If I use ftgen statements 
in that area as well, all would compile fine if the ftgen statements 
were located before the user-defined opcodes.  If they were placed after 
the user-defined opcodes, an error statement along the lines of:

error:  misplaced opcode, line 136:
gi_scanned_matrix_steven2               ftgen 0, 0, 16384, -23, "steven2"

would occur for every ftgen statement.

I've attached two CSD files that demonstrate the error.  The files are 
barebones and the only difference is in the location of the ftgen 
statement.  The one marked good will compile without error, while the 
one marked bad will give an error.

I'm not sure if this a known issue with working with User-Defined 
Opcodes or not (I couldn't find documentation on it).  I'm going to take 
a look at source code to see what causes this but if anyone can fill me 
in if this is the way it should be please let me know.

BTW: This is the case with both csound4 and csound5.

Thanks,
steven



Date2004-09-18 15:52
Fromjpff@codemist.co.uk
Subject[CSOUND-DEV:5335] Re: ftgen and user-defined opcodes
You and the rest of use are confused!  The opcodes upto SETEND == 8
are special and are only allowed in Instr0.  I never understood the
named opcode stuff, but I suspect there is an interaction with the
"realops" section of oload.c

Not checked in detail yet, but a little use of gdb should nail it
quickly.

==John ffitch