Here's what I would do based on your example. Of course there are many
options of using envelope objects.
I would also suggest to use something else than [phasor~] because of
aliasing problems.

Ingo


________________________________________
Von: pd-list-boun...@iem.at [mailto:pd-list-boun...@iem.at] Im Auftrag von
Andrew Faraday
Gesendet: Montag, 22. November 2010 23:36
An: pimas...@gmail.com; samueldavidr...@hotmail.co.uk
Cc: pd-list@iem.at
Betreff: Re: [PD] Simple Subtractive Synth filter envelope

hello samuel

[vcf~] is probably the way to go.

you can also cheat a little using [envgen] which is a graphic envelope
generator, currently set between 0 and 1. The documentation isn't perfect,
but these are the messages you need to know.

[0 50 1 50 ( <--- slightly different syntax from [line] or [line~], it goes,
target (first one's instant), gap, target, gap etc.

[duration 5000( < --- changes the duration of your envelope without changing
the shape.

a bang outputs the messages for [line] or [line~] or [vline~].

you can also draw your envelope manually.


This is useful if you don't want to spend much time on sorting out your
envelope generator. Oh, and the 0 to 1 problem. In audio you'll have to do
some arithmetic, but if you use a signal line you can use [range 0 1 X X]
replacing the x's with the upper and lower limit you want for your filters. 

Hope this helps

Andrew

P.S. to convert the audio 0 - 1 to a range you want, use 

[line~]
|
[*~ (the size of your range)]
|
[+~ (the lower limit of your range)]



________________________________________
Date: Mon, 22 Nov 2010 23:10:47 +0100
From: pimas...@gmail.com
To: samueldavidr...@hotmail.co.uk
CC: pd-list@iem.at
Subject: Re: [PD] Simple Subtractive Synth filter envelope

Would this do? 

You should be aware that there is a difference between "message" and "audio"
inlets (different color). The sound may be very diffrent depending on the
type of inlet an audio object has if you want to change a parameter
dynamically. This is particularly relevant for filters. Check the difference
between [bp~] and [vcf~]. 

Pierre
2010/11/22 samuel rowe <samueldavidr...@hotmail.co.uk>
Hi

I'm relatively new to PD, but I've been working with hardware synthesizers
for years now, and I've used SynC to build synths on my computer, and I'm
doing an Audio Technology degree, so I'm not clueless on the subject. 
However, I'm trying to build a simple subtractive synth where I press a
PutBang which triggers an envelope generator with ADSR to alter the filter
cutoff, and I just can't work out how to do it. No-one at my university
program in pd or max, so I have had to search the internet for help. I've
read these two pages

http://obiwannabe.co.uk/html/music/6SS/six-simple-synthesisers.html
http://en.flossmanuals.net/PureData/SimpleSynth

and whilst the vline object on the flossmanuals site is fine when altering
the envelope of an overtone in an additive synth, the output will not feed
into the argument for a filter cutoff value. I can't even get the "attack
decay" generator on the first site to work, let alone figure out how to
alter it's seemingly inefficient design to allow sustain and release.

I know this is quite trivial compared to some of the things that get posted
in the mailing list, I would really appreciate it if anyone could help me,
or point me in the right direction. I've spent too many nights scouring the
internet and trying to work it out for myself, but I've simply hit a brick
wall.

Thank you in advance

Samuel

p.s. this is the text for the file i have been working on, it's a little bit
messy and doesn't seem to work properly. BE CAREFUL, IT MAKES A THUMP WHEN
OPENED, TURN OFF "COMPUTE AUDIO"

#N canvas 366 35 610 629 10;
#X obj 106 485 dac~;
#X obj 94 115 phasor~;
#X floatatom 104 77 5 0 0 0 - - -;
#X obj 231 154 bng 15 250 50 0 empty empty
hit_to_trigger_envelope_and_make_sound
17 7 0 10 -262144 -1 -1;
#X obj 152 116 phasor~;
#X obj 109 175 +~;
#X obj 151 140 -~ 0.5;
#X obj 96 140 -~ 0.5;
#X obj 167 96 *~;
#X floatatom 182 30 5 -25 25 1 osc2_detune - -;
#X obj 182 75 +~ 1;
#X obj 181 52 /~ 10000;
#X obj 207 258 del;
#X obj 200 321 0 \$1;
#X obj 273 324 1 \$1;
#X obj 235 357 line;
#X floatatom 331 175 5 0 0 1 attack_value? - -;
#X floatatom 337 228 5 0 0 1 decay_value? - -;
#X obj 110 376 lop~ 3000;
#X obj 110 403 lop~ 3000;
#X obj 110 427 lop~ 3000;
#X obj 110 451 lop~ 3000;
#X obj 214 203 t b b;
#X obj 254 196 t f f;
#X obj 206 288 f 50;
#X obj 249 287 f 50;
#X obj 217 391 + 20;
#X connect 1 0 7 0;
#X connect 2 0 1 0;
#X connect 2 0 8 0;
#X connect 3 0 22 0;
#X connect 4 0 6 0;
#X connect 5 0 18 0;
#X connect 6 0 5 1;
#X connect 7 0 5 0;
#X connect 8 0 4 0;
#X connect 9 0 11 0;
#X connect 10 0 8 1;
#X connect 11 0 10 0;
#X connect 12 0 24 0;
#X connect 13 0 15 0;
#X connect 14 0 15 0;
#X connect 15 0 26 0;
#X connect 16 0 23 0;
#X connect 17 0 24 1;
#X connect 18 0 19 0;
#X connect 19 0 20 0;
#X connect 20 0 21 0;
#X connect 21 0 0 0;
#X connect 21 0 0 1;
#X connect 22 0 12 0;
#X connect 22 1 25 0;
#X connect 23 0 12 1;
#X connect 23 1 25 1;
#X connect 24 0 13 0;
#X connect 25 0 14 0;
#X connect 26 0 18 1;
#X connect 26 0 19 1;
#X connect 26 0 20 1;
#X connect 26 0 21 1;

_______________________________________________
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list


_______________________________________________ Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
#N canvas 132 125 924 885 10;
#X obj 224 777 dac~;
#X obj 295 222 bng 15 250 50 0 empty empty trigger_envelope 17 7 0
10 -262144 -1 -1;
#X obj 224 233 +~;
#X floatatom 422 243 5 0 1000 1 attack_time_(linear) - -;
#X floatatom 422 323 5 0 0 1 decay_time_(logarithmical) - -;
#X obj 295 243 t b b;
#X obj 407 423 f;
#X floatatom 624 557 5 21 127 1 sustain_value_(midi) - -;
#X obj 525 359 vsl 15 128 21 127 0 0 empty empty filter_max 20 3 1
9 -262144 -1 -1 10064 1;
#X text 466 90 Warning : there are cold and hot inputs in some Pd objects
;
#X text 465 109 The float object [f ] only outputs a value if the hot
(left) inlet is triggered. Sending a value through the cold (right)
inlet will only store it \, not output it.;
#X obj 224 648 lop~;
#X obj 224 675 lop~;
#X obj 224 699 lop~;
#X obj 224 723 lop~;
#X obj 397 470 line;
#X obj 397 680 *;
#X obj 397 737 +;
#X obj 397 534 *;
#X obj 397 512 t f f;
#X obj 397 578 *;
#X obj 397 556 t f f;
#X obj 624 596 t b f;
#X obj 624 576 mtof;
#X floatatom 676 593 5 0 0 1 sustain_freq - -;
#X floatatom 565 490 5 21 127 1 filter_max_(midi) - -;
#X obj 525 500 mtof;
#X floatatom 565 517 6 0 0 1 filter_max_freq - -;
#X msg 407 443 1 \, 0 \$1;
#X msg 362 290 stop;
#X obj 525 643 -;
#X text 571 637 Subtract sustain value from filter_max;
#X text 571 647 so sustain value doesn't affect the max setting;
#X text 421 736 Add sustain value at the end;
#X obj 750 199 loadbang;
#X msg 760 306 3000;
#X msg 750 540 60;
#X text 392 289 stop decay when retriggering;
#X msg 466 43 \; pd dsp 1;
#X text 434 509 this;
#X text 434 529 makes;
#X text 434 539 the;
#X text 434 549 curve;
#X text 434 559 logarithmic;
#X text 434 519 multiplication;
#X obj 15 32 notein;
#X obj 37 86 mtof;
#X obj 57 133 nroute 0 2;
#X obj 57 113 pack;
#X msg 57 159 0;
#X msg 114 159 \$1;
#X text 6 133 note off;
#X text 121 133 note on;
#X obj 114 179 t b f;
#X obj 15 59 poly 1 1;
#X text 794 226 attack;
#X text 794 305 decay;
#X text 794 340 filter freq;
#X text 794 540 filter sustain;
#X text 67 54 use to retrigger;
#X text 67 64 without cutting off;
#X text 204 442 always add starting value of line;
#X msg 760 226 0;
#X text 144 808 you should still add a release which works the same
as the decay and gets triggered by the note off.;
#X obj 224 48 cnv 15 220 160 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 244 156 phasor~;
#X floatatom 244 81 5 0 0 1 osc_freq - -;
#X obj 322 156 phasor~;
#X obj 322 176 -~ 0.5;
#X obj 244 176 -~ 0.5;
#X obj 322 136 *~;
#X floatatom 337 80 5 -25 25 1 osc2_detune - -;
#X obj 337 119 +~ 1;
#X obj 337 99 /~ 1000;
#X obj 337 26 loadbang;
#X msg 244 53 220;
#X text 13 9 MIDI IN;
#X msg 337 53 7;
#X obj 8 441 cnv 15 190 310 empty empty empty 20 12 0 14 -261682 -66577
0;
#X obj 46 721 *~ 1;
#X obj 46 522 *~;
#X floatatom 124 486 5 0 200 0 - - -;
#X obj 124 505 / 100;
#X obj 67 659 *;
#X obj 67 637 t f f;
#X obj 67 701 *;
#X obj 67 679 t f f;
#X obj 46 542 hip~ 300;
#X text 16 489 frequences;
#X obj 67 617 *;
#X obj 67 595 t f f;
#X text 104 599 this;
#X text 104 619 makes;
#X text 104 629 the;
#X text 104 639 curve;
#X text 104 609 multiplication;
#X text 104 659 logarithmic;
#X text 104 649 extremely;
#X text 16 449 add this;
#X text 16 479 on lower filter;
#X text 16 459 attack bypass for;
#X text 16 469 extra attacks;
#X obj 534 198 cnv 15 210 30 empty empty empty 20 12 0 14 -257985 -66577
0;
#X text 542 199 attack uses a linear curve;
#X text 542 209 decay uses a logarithmical curve;
#X msg 760 340 105;
#X obj 295 7 bng 15 250 50 0 empty empty hit_to_trigger_envelope_and_make_sound
17 7 0 10 -258113 -1 -1;
#X obj 282 276 cnv 15 70 140 empty empty attack 20 12 1 12 -233017
-66577 0;
#X obj 295 299 f;
#X obj 295 339 line;
#X obj 295 359 t f f;
#X obj 295 386 sel 1;
#X msg 295 319 0 \, 1 \$1;
#X text 78 314 always add starting value of line;
#X text 78 324 to retrigger envelope from start;
#X text 184 385 start decay on 1;
#X text 144 838 in this case make sure the note off gets delayed by
the release time on the way to the phasor frequency "0".;
#X connect 1 0 5 0;
#X connect 2 0 11 0;
#X connect 2 0 80 0;
#X connect 3 0 108 1;
#X connect 4 0 6 1;
#X connect 5 0 108 0;
#X connect 5 1 29 0;
#X connect 6 0 28 0;
#X connect 7 0 23 0;
#X connect 8 0 25 0;
#X connect 8 0 26 0;
#X connect 11 0 12 0;
#X connect 12 0 13 0;
#X connect 13 0 14 0;
#X connect 14 0 0 0;
#X connect 14 0 0 1;
#X connect 15 0 19 0;
#X connect 16 0 17 0;
#X connect 17 0 12 1;
#X connect 17 0 13 1;
#X connect 17 0 14 1;
#X connect 17 0 11 1;
#X connect 18 0 21 0;
#X connect 19 0 18 0;
#X connect 19 1 18 1;
#X connect 20 0 16 0;
#X connect 20 0 90 0;
#X connect 21 0 20 0;
#X connect 21 1 20 1;
#X connect 22 0 17 0;
#X connect 22 0 30 0;
#X connect 22 1 17 1;
#X connect 22 1 30 1;
#X connect 23 0 22 0;
#X connect 23 0 24 0;
#X connect 26 0 27 0;
#X connect 26 0 30 0;
#X connect 28 0 15 0;
#X connect 29 0 15 0;
#X connect 30 0 16 1;
#X connect 34 0 62 0;
#X connect 34 0 35 0;
#X connect 34 0 105 0;
#X connect 34 0 36 0;
#X connect 35 0 4 0;
#X connect 36 0 7 0;
#X connect 45 0 54 0;
#X connect 45 1 54 1;
#X connect 46 0 48 0;
#X connect 47 0 49 0;
#X connect 47 1 50 0;
#X connect 48 0 47 0;
#X connect 49 0 66 0;
#X connect 50 0 53 0;
#X connect 53 0 1 0;
#X connect 53 1 66 0;
#X connect 54 1 46 0;
#X connect 54 2 48 1;
#X connect 62 0 3 0;
#X connect 65 0 69 0;
#X connect 66 0 65 0;
#X connect 66 0 70 0;
#X connect 67 0 68 0;
#X connect 68 0 2 1;
#X connect 69 0 2 0;
#X connect 70 0 67 0;
#X connect 71 0 73 0;
#X connect 72 0 70 1;
#X connect 73 0 72 0;
#X connect 74 0 77 0;
#X connect 74 0 38 0;
#X connect 75 0 66 0;
#X connect 77 0 71 0;
#X connect 79 0 0 0;
#X connect 79 0 0 1;
#X connect 80 0 87 0;
#X connect 81 0 82 0;
#X connect 82 0 80 1;
#X connect 83 0 86 0;
#X connect 84 0 83 0;
#X connect 84 1 83 1;
#X connect 85 0 79 1;
#X connect 86 0 85 0;
#X connect 86 1 85 1;
#X connect 87 0 79 0;
#X connect 89 0 84 0;
#X connect 90 0 89 0;
#X connect 90 1 89 1;
#X connect 105 0 8 0;
#X connect 106 0 75 0;
#X connect 106 0 1 0;
#X connect 108 0 112 0;
#X connect 109 0 110 0;
#X connect 110 0 111 0;
#X connect 110 1 16 0;
#X connect 110 1 79 1;
#X connect 111 0 6 0;
#X connect 112 0 109 0;
_______________________________________________
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list

Reply via email to