Cabbage Logo
Back to Cabbage Site

genTable and ftmorf

Hello everybody!

I’m working on a pulsar synthesizer where i want to see some parameters in the genTable widget.

For example:
I am interpolating between different f-table via ftmorf to change e.g. the attack envelope of the pulsaret.
Now i want to be able to see the result of ftmorf in genTable.

I tried some different ways but none of them is working.
E.g. i triggered a different instrument to update the table.
also i thought this should be the solution:

  kAttIndex, kAttIndexTrig cabbageGetValue "attIndex"
  ftmorf kAttIndex, 1, 100
  giAttTable = 100     
  if changed(kAttIndex) == 1 then
      chnset 100, "attTable"
  endif

But it doesn’t work.
Can somebody help?

Edit:
i found out doing it with another guiMode, but this introduces some trouble with other opcodes.

Did you look at the gentable widget example? It shows how to display the contents of a dynamically changing table. It’s a good tarting point for this kind of thing. If you did, but your instrument is still not working, post a simplified the .csd and I’ll take a look.

Ah, i ignored this example file, because this one is not working (?)…
But now i’ve checked it again and i figured it out now.

But i have another problem with gentable. Most of the time the visuell content of the table is compressed to the left. i don’t think it has something to do with the values itself, but more like genTable is visualizing them.
Bildschirmfoto 2023-09-10 um 08.10.53

my csd: partikkel-masking-001.csd (5.1 KB)

second thing i noticing:
implementing a second table, just like the first, gives me a result like this:
Bildschirmfoto 2023-09-10 um 09.21.22

The second table is not showing anything. Sometimes, when i start cabbage new, both tables act like they should. But when i stop the instrument and start it new they are just like in the picture.
Also sometimes the channel("") gets deleted out of nowhere in the section.

The actual csd: partikkel-masking-001.csd (5.4 KB)

Hmm, that gentable example is working fine for me? What version of Cabbage are you using? And your posted .csd also seems to be doing what I’d expect?

image

This is weird. I’m on 2.9.93.

For it’s only working when i start the patch for the first time. when i stop it and then start it again it’s like i described.

I did a short video of my screen, so you can see what is happening:

If I run the instrument you posted, it looks like this:

So, it probably has nothing to do with my .csd file. could any system preferences be the weak point?
BTW here is the actual .csd file with still the same problems.
pulsar.csd (5.4 KB)

I’m stumped. We’re both using the same version of Cabbage. I’m using Csound 6.18. I can’t see why things would be different on your machine. I’m using an M1 Mac btw, but I don’t see how that would make any difference.

I got it, I’m using 48kHz. When I switch to 44.1 I get the same issue you see. I’ll take a look and fix this tomorrow :slight_smile:

This is it. Running on 48kHz i also have no problems.

I just pushed a fix now and triggered a new beta build. The reason this was going crazy is that the gentable widget should only really be used ti display small tables. So there was a fixed limit on the table size. If the table gets too big, it changes to a more efficient means of display. I’ve increased this limit and the issue is no longer there. I’m not sure you noticed any performance issues yet, but if you only need a basic waveform display, then the soundfiler is far more efficient. It can also show tables, so if you do find things getting a little sluggish, I’d switch to using a soundfiler widget. :+1: