I'm new to PD and don't really understand how it works and I need urgent help with a practice, it consists of the following:
a. Design and implement an envelope.
b. The envelope should work as a subpatch.
c. Test the envelope using an LFO and some kind of signal generator. You can use any kind of synthesis.
d. Show at least two practical examples of the use of the envelope.
Expected results
You should have a patch showing the use of the envelope. This should show:
• The envelope as a subpatch.
• The LFO as a subpatch showing the main controls.
• A patch demonstrating the usefulness of the low frequency oscillator and the envelope. This demonstration should be clear and well-founded.
o Sound generation
o Drum synthesis
Please, someone help me
-
Envelope and LFO
-
Envelopes seem to be one of those things in Pd that people find tricky to figure out on their own... so, here are a couple of simple formulas that I use.
Since these use inlet and outlet~, they'll work as subpatches, where the left input is a trigger or gate, and the right input is a list of parameters. You could have a separate input for each parameter if you want; I'm just lazy.
I'm not sure what your professor means by "test the envelope using an LFO."
hjh
-
@ddw_music you can't really square the value in case it's a volume envelope, because that will square the sustain value as well, and that will reduce the actual value. I understand that squaring will create curves, but you need a more complex logic to get the curves but maintain the sustain value.
-
@alexandros said:
@ddw_music you can't really square the value in case it's a volume envelope, because that will square the sustain value as well, and that will reduce the actual value.
Fair -- squaring is a bit of a hack to make up for the lack of a curved-segment envelope generator (like EnvGen in SC, where segments can be linear, exponential, sinusoidal, curved by a curve factor, maybe a couple others, built-in
).
hjh
-
@ddw_music unless, you do square it, but set the sustain value through a [sqrt] first, so when squared, it gets to the correct value!
-
@ddw_music I thought about it and it turns out that just squaring is not enough, even if you store the square root of the sustaing value. If you just square, the curve of the attack will be inversed (it will be exponential instead of logarithmic). You need some more logic to inverse the power you raise the amplitude to, depending on the direction of your signal. Here's a snapshot of my take.
[adsr] is an abstraction I have built. It stores the square root of the sustain value. What's important here is the logic underneath [vline~]. Here I'm using zexy's [z~ 1] to get the previous sample and compare it to the current one. If the current sample is smaller or equal to the previous one (the decay, sustain and release parts), then the envelope is raised to the 2nd power, otherwise, it is raised to 0.5.
This way, you can get the correct curvatures. -
@alexandros If I understand correctly, that method interrupts the decay curve and we can see that in the transition from the decay to the sustain, not as smooth as it should be? The way I do it is make every segment run from 0 to 1 and then scale and offset to the proper values. Much of the time I don't think it would matter, we would not hear the flaw in your method, if there is one, guessing based off of the image but don't really know since I am not completely sure what is in your abstraction. Here is roughly how I do it. Mostly posting to see if I understand and for the sake of discussion, if I do understand I think for most uses your method is more sensible.
-
@oid you're write about making all ramps go from 0 to 1, apply curvature, and then scale and offset to bring them to the desired range. I've done that too in a project of mine, but it's quite some more work. As you write, the approach above is probably good for most applications. I did this as a reply to @ddw_music's post.