Cabbage Logo
Back to Cabbage Site

Using fillarray at i-rate

I’m trying to using fillarray inline at i-rate (fillarray:i(0, 1, 2, 3, 5, 8)), but Csound complains with…

error: error: opcode ‘fillarray’ for expression with arg types cccccc not found, line 136

It seems the only way around this is to have an explicit array defined outside of the inline call.

Is there a way to keep this an inline call?

I don’t think you need the i specifier. Try:

iTest[] = fillarray(0, 1, 2, 3, 5, 8)

I don’t think I explained myself well enough…

I’m trying to do something like

iBB[] = bb_get(iInBoxes, fillarray(0, 1, 3, 4))

error:  error: opcode 'bb_get' for expression with arg types i[][]k[] not found, line 138

It would appear that fillarray defaults to a k-rate, and when I try

iBB[] = bb_get(iInBoxes, fillarray:i(0, 1, 3, 4))

error:  error: opcode 'fillarray' for expression with arg types cccccc not found, line 138

The only solution I found is to break out the fillarray and assign it’s results to a variable, and then pass that variable into my function call.

iArr = fillarray(0, 1, 3, 4)
iBB[] = bb_get(iInBoxes, iArr)

Hopefully that is a better explanation.

Oh right. In this case I think your solution is the only workable one. :+1:

1 Like

I like Csound, but it is quirky! Especially in moving towards the functional coding style. I love using the new style, but it still is limited for complex code.

Maybe if I get around to it, I’ll ask on the Csound like, or at least look and see if it has been asked and answered…

I know. I’m the same. It works great in parts, but totally fails in other areas.