a-d function generator (seeking advice)
hi all ~
one of the projects i'm currently working on is recreating a particular a-d function generator in pd. i'm in the early stages of development with this, and relatively new to pd, so this might be a simple question to answer. right now i have my attack and decay sliders set up to output floats to a pack, then onto a message containing $ variables which is then passed to vline. ideally this should allow for a user to modulate the attack and decay times in realtime - using some means of input (bang, note, etc.) to trigger or re-trigger the envelope. an issue i am running into is that while the decay slider can be modulated without the envelope being triggered, the attack slider triggers the envelope any time an adjustment is made. my suspicion is that this has to do with pack, as it outputs when it receives a float to its first inlet. so i suppose this is my question: is there a way to prevent pack from sending when this adjustment is made? is there another object i should be using instead to aggregate the floats? any thoughts or advice would be much appreciated!
here's a screenshot of the subpatch for reference 
Array settings 'break' Pd gui and control.
Hello. I'm messing about with creating envelope generators in Pd using arrays.
I've tried to make the array's settings easily changeable to allow it to work for amplitude, pitches and other uses, using variables sent to a message for the array.
But I've found that most of the time with this setup I just patched up I will, with a lack of better words, break Pd, get a bunch of error messages in the terminal and number boxes will stop showing changes, alongside dragging in values on the array.
The patch in questions and the error message is shown here:


The values shown in the picture work fine, those are set up as an amp envelope. Changing certain parameters will break it, I can't quite be sure which. Sometimes I will just get the "graph: empty bounds rectangle" message, which will usually be followed by the more verbose error message.
The changes seem to be made, but it just won't show it. I have to completely quit Pd and open it again for it to return to normal.
As soon as the error message occurs, the number boxes will freeze and add "..." to the end, as if the number shown exceeds the width of the box, which is not the case.
I assume I'm running Pd into a wall, placing values that are out of bounds for the given array, but I can't tell how and why. It's my first venture into using graphical envelopes, I've usually just used the more primitive version of line ramps and delayed signals to get regular adsr envelopes.
Can anyone tell me what I might be doing wrong here?
I'm running vanilla 0.47.1 on a Macbook Pro running El Capitan.
Thank you.
I love my envelope except when it gets stuck on -- problem using with poly?
Thanks for all the suggestions about this. I'm going to keep plugging away and report back when I find the fix, though I'll probably ultimately take th8a's suggestion of using tables for the envelope segments so I can eliminate the hacky way I'm using threshold~.
I've been building in lots of print and env~ objects to try to figure out where the exact problem is. I believe I've successfully determined that it's NOT the voice stealing or the threshold~ object. All the midi info seems to be getting routed to the right voices, and the decay segment seems to be playing correctly even in notes that get stuck on, which it's the purpose of the threshold~ object to trigger.
For some reason the midi off control seems to be sent to the envelope, but it isn't registering it. I can fake another off event with messages and the envelope releases normally at that point. I've been playing around with a slightly more complex synth patch that uses the same envelope abstraction, which is actually a little more helpful because it has multiple oscillators for each voice, and they do NOT all seem to get stuck on at once. In fact, the base oscillator seems to be the only one that gets stuck on, whereas the 2 suboscillators do not, which suggest to me that I might have screwed up the construction of how the oscillator patch interacts with the envelope. But I'm still only closer to figuring it out; I haven't had much time to mess around with it lately.
Attempting to make a vocoder, HELP
I tried messing around with your patch and got good results when I
-replaced env~ with a peak envelope follower (highest~ from my library) rather than an rms one
-used 2 filters everywhere there is 1
-set the q to 10-15 in each bandpass filter
-use a line~ after the envelope follower to convert to signal that has interpolation time equal to the rate of output of the envelope follower
-use a [lop~ 10] between [line~] and [*~ ] to take the high frequencies out of the line~ signal (which has first-derivative discontinuities)
I used a block size of 64 for the envelope follower
Attempting to make a vocoder, HELP
Hello, I am attempting to make a vocoder inside of pure data, I understand (I think) how a vocoder should work, ie you press the vocal signal through an amount of bandpass filters and then through an envelope follower, while passing the carrier signal through the same set of filters but without the envelope follower, I have done this and connected the envelope follower to my amplifier object but simply get a static noice that slightly dips and falls with the vocal. Any help would be greatly appreciated.
Vocoder2.pd This is my attempt
Problem with making a decay envelope that works with lop~ filter
Hello!
I am trying to make an modulation envelope that works with the lop~ filter. The lop~filter uses a control inlet for the filter frequency where vcf~ and bp~ uses a signal inlet. And the envelope I have made works perfectly for the vcf~ & the bp~ but not the lop~.
I tried using snapshot~ to convert from signal to control, but the result is not good, even when I feed the snapshot~with a very fast metro to refresh it rapidly.
My patch looks like this:

The subpatch on the left side is the sequencer so you can see what signal I feed into the envelope. When I am live with the patch I can see that the envelope receives a trigger signal. So I am pretty sure the inlet/trigger part is working, so I dont think that is the issue.
On right side is the envelope that I cannot get working with the lop~ filter.
Does anyone have a suggestion to:
a. What I can do to either get the decay envelope I all ready have working in another way than using snapshot~.
b. Make a new decay envelope that uses control signal. Or maybe there is all ready one? I havent been able to find one....
Any help appreciated!
Thanks, Jaffa!
Polyphonic voice management using \[poly\]
Didn’t do a good job explaining my issue. And sorry about forgetting the abstraction. Didn’t think about that.
My issue isn’t really related to the envelope, AFAIK. Had the same problem sending MIDI out (where the external synth dealt with the envelope). The idea is to have notes play as long as the key is pressed on a MIDI keyboard (or air is flowing through my wind controller). On key up (or breath stopping), some controllers send a velocity of 0 that Pd uses as “note off”. My intention is to finish the note when that happens. Works really well with [poly] when the voices remain the same. With or without the envelope. But my little rotating offset throws off [poly] and that’s when notes start hanging.
@whale-av Your idea of collecting incoming notes is pretty good but how is that done? Should it be [tabwrite] and [tabread]?
exponential ADSR envelope using LP filter
Hi. I've played with this method before a bit. A real 1-pole lowpass filter with an impulse passed in is equivalent to multiplying every previous sample by a constant factor to get the next sample, which is also equivalent to an exponential envelope. But you can also add a constant factor for every sample in order to make a linear envelope. So it turns out you can make a variable-slope filter by combining: multiply and add on the previous sample by 2 different factors. If you are interested I have further details in this blog post:
https://sshader.wordpress.com/2014/09/05/programming-an-adsr-envelope/?iframe=true&theme_preview=true
It's not that cpu friendly when you change the settings because you have to take the sample-length-of-the-stageth root or something like that, I haven't looked into it in a while though. However, afterward it simplifies to an add and multiply at every sample
here are the codes: http://forum.pdpatchrepo.info/topic/8490/examp-exponential-envelopes-with-exponential-linear-curve-control
exponential ADSR envelope using LP filter
I've been experimenting with making an exponential envelope using filters rather than lines. Instead of trying to re-process the linear data that [line~] objects make, I'm giving a hard 1 or 0 signal to a LP filter with very low cutoff to take create the curve.
Maybe this is an old trick, but it's new to me and I've been very pleased with the results. It gives nice, varied envelope curves, and it's satisfyingly simple and CPU friendly.
ADSR clips when triggering new note while old one is releasing
I guess what you need is [pipe] and check if a new envelope is triggered before the previous has ended. That's what I did in [hold_sustain], an abstraction that works with [ggee/envegen] in order to hold one point of the envelope (designed mostly to hold the sustain part of an ADSR). You can get it here https://github.com/alexdrymonitis/envelopes check its help patch and the actual abstraction to see if it can help..





