Hi again, haven’t posted here in a while. I’m working on another plugin that, similar to the other one I made, divides the signal into a given number of bands that’s controlled by a slider and goes up to 100, and then frequency shifts them by the same amount + an extra control that “tilts” the frequency shift values, shifting the low bands by a larger amount when tilted to the right or the high bands when tilted to the left. There’s also the option to randomize the shift amount on each band by a given range. I made this system by generating two fuction tables, one for the tilt and another one for the randomization, updating them with the knob values when they are changed and then accessing their values using the tabmorph opcode to give the user the control to transition between them so he can control the range of randomization after tilting (or just not tilt at all and just randomize. The thing is, there’s this error that I can’t get rid of:
INIT ERROR in instr 1 (opcode tabmorph) line 324: tabmorph: invalid table number
I tried both using both the “gir” and “ifn” arguments of the ftgen opcode I used to generate the tables and update them in the “ifn1” and “ifn2” init parameteros of tabmorph, without success. What am I doing wrong?
By the way, if you’re wondering why didn’t I do it in the spectral domain, it’s because after checking out some examples to learn how to code spectral csound I concluded that I just don’t really like how “vocodey” it sounds, it’s kinda like the sound looses it’s edge with the fft processing that csound does (idk maybe it’s just me and I haven’t looked into it enough), and meanwhile I don’t really mind the phase issues of just stacking all those bandpass filters. Also, I didn’t use an UDO to do all the duplicates instead of just bruteforcing it because I had already started this code before I even knew what UDO’s were, and tbh I’m kinda too lazy to convert all the duplicated code into udo’s might do it one day if I see that it really does affect the performance but right now i’m not really sure about it (rn I’m using a tool that lets me duplicate code with incrementing numbers, it isn’t really that hard to work with so much duplicated code using that and the built in find and replace tool).
pd. there is already an UDO in the code because the whole thing is a modified version of Ian McCurdy’s frequency shifter from 2013 I found and reused to save time because at the end of the day I wasn’t gonna sell this plugin or anything so I thought I’d save time. The code already had the frequency shift udo. My dumbass did not understand how that worked anyway for quite some time even though a quite self explanatory exaple was just sitting in front of my eyes
Here’s the csd file
Misshaper.csd (266.9 KB)
- The code’s quite large due to all the duplication, so here’s where all the relevant stuff is: the tables are generated in the first 4 instruments before the main one (inst 1), and the tabmorph arguments are used throughout the bands in the kfshift setup section at line 322 and in the frequency shifters section at line 1175