Cabbage Logo
Back to Cabbage Site

Gentable : how to set a fixed Y value?

Is there a way to fix the values for x and y maximum of the gentable widget ?
i.e . : x from 0 to 200 and Y from 0 to 1 with no re-scaling of the values when the value of the table are changed.

I am not sure I follow? Are you taking about what values are displayed, or the values stored in the actual function table?

[edit] amprange() any use to you?

It is about the displayed values. I think amprange() is the answer but I don’t understand very well how it works.

In short, I am still dealing with envelopes.
I wish to use the gentable widget to create envelope like @iainmccurdy has done in the gen08 example, but this example requires quite a little effort to understand :slight_smile: also, this type of envelope is not midi compatible in that way that the durations are fixed.

I am dreaming of a widget which would allow to graphically design an enveloppe using the opcode_r family (linsegr, transegr,) , provided that the last segment would always be the release one.

Hmm, Iain’s gen08Envelope example is not working for me here. Is it loading Ok for you? I’m getting invalid ftable messages.

So do I but the envelopes work anyway. Maybe this is only at init time.

Good to know. Looks like my dev build here has broken something :unamused: Let me fix this first and then I’ll try to prepare a simple ADSR env widget for you.

Btw, are you using the latest Windows version from a few days ago?

[edit] if not would you mind trying?

I use 2.0.28a version from Xmas : CabbageCanonicalSetup_Sat_Dec_23_16-59-29_2017.exe
Is there a newer version ?

There have been many :joy: I just checked the latest and it seems to work fine for me, even with the invalid ftable errors. Must be my local build. Phew!

I use 2.0.28a version from Xmas : CabbageCanonicalSetup_Sat_Dec_23_16-59-29_2017.exe>.

Just downloaded and installing version of 30 december.

At least , the PM synth I just posted is working very well with it.

Don’t worry the later ones should be fine too. I was using a slightly older version of Csound on Linux here which was causing the problems. updating fixed it. I will look at preparing a simple env generator for you later on today. I have to leave things for now. A+

So I guess what you would like is something like this. Hmm. How best to implement this is the question. A bit of a challenge to Cabbagers everywhere :wink: I’ll see what I can come up with.

Yes, not far from that.It seems to be quite a challenge.
Somehow, if you try the last synth I posted today, you can have a look at osc2 to 5. There are parameters for envelop using transegr opcode.
Envelope is made of a delay, an attack duration, a maximum peak to reach, a decrease duration, à sustain level and a release segment. Of course, the shapeof the curves are fixed for now.

It’s very easy if you can use sliders to control segments, but modifying the ADSR with handles seems to be a bit tricky. I tried Iain’s approach of using label and check for mouse positions. It seems a little shaky. Must be a better way. Just use a GEN07 with a gentable is fine, but you can’t guarantee a horizontal sustain level. I’m sure Iain has an eloquent solution for this!

The more I worked on this the more I think I followed more or less the same path as Iain did in his example! I will take it as a compliment to my Csound skills :wink: I will now go and see what I can learn from how Iain did it. All I know at the moment is he also uses mouse events too.

DynamicEnveloper.csd (4.2 KB)

Thank you a lot @rorywalsh ! I’ll try to develop something based on your code.