Cabbage Logo
Back to Cabbage Site

Understanding an error message

I’m trying to create a set of tables, and in the process of running my code, I get this message…

error: Unable to find opcode entry for ‘ftlen’ with matching argument types:
Found: i ftlen cciccicic

I’ve gotten this error message before, but I don’t recall ever seeing the letter ‘c’ used in the signature of an opcode. What do the ‘c’ characters represent? This is the code for the opcode I’m writing.

giTableSize = 1024

giShapeCount = 128
giShapes[] init giShapeCount

opcode initShapes, 0, 0
    iCount = 0
    iStep = (giTableSize / 2) / giShapeCount
    iSeg1 = 0
    iSeg2 = 1024
    while iCount < giShapeCount do
        prints "iCount: %d iSeg1: %d iSeg2: %d\n", iCount, iSeg1, iSeg2
        
        giShapes[iCount] ftlen 0, 0, giTableSize, 7, 0, iSeg1, .5, iSeg2, 1
        iSeg1 = iSeg1 + iStep
        iSeg2 = iSeg2 - iStep
        iCount = iCount + 1
    od
endop

ftlen returns the length of a table, I think you should be using ftgen.

Apart from that I think the c's refer to constants. I always find it a little frustrating that Csound lists the type of parameters you have given, instead of the one that should be given.

Man, guess I need some sleep. I looked at that code for at least an hour or more, and I didn’t notice that I had the wrong opcode…

Thank you.

I’ve been there before!

Thanks, again. Everything is working as expected!