Cabbage Logo
Back to Cabbage Site

Summing/Layering of Audio stored in ftgen tables

Hi everyone!

I try to sum the Audio Information of two or more ftgen tables that host audio files or audio recordings to one table or sort of bus, but without luck yet.

What kind of ways do I might have to do this?

Thanks for any help!
//rootnote

You can combine the outputs from multiple tables into one table, if you like. In pseudo code it might look like this (make sure that all tables are the same length):

while iCnt < ftlen(iFn1) do
    a1 tab iCnt, iFn1
    a2 tab iCnt, iFn2
    tab (a1+a2)/2, iCnt, iFn3
    iCnt += 1
od

if you only need them summed when you output them, simple sum and output.

thanks @rorywalsh ! Is there maybe an opcode that does that as well? The flooper2 does it somehow, but I dont need the looping functions.

thanks

No, you need to do it manually, but it’s not a lot of effort…

I will try to translate your pseudo code. Thanks so far!

It should run as it is if you use the right versions of tab opcodes for reading and writing. I think the rest of the code is pretty much Ok.

Hi @rorywalsh
ok, tried it but tab gives me t_opcode failures.

Anyway, what I really need would be to sum ftgen tables that store IR files.
My goal is to have one mixed IR file out of all the tables to reduce the need of many convolution modules in parallel, which will add up in CPU consumption.

image

Maybe you have an idea to that?

Thanks!!!

Check the Csound manual for table opcodes, you’ll find the right opcode name there. Still seems to me like tab, or whatever it’s called, is the best option :+1:

[edt] https://csound.com/docs/manual/tab.html