adsr~ questions including example patch


    Mar 12 2008 | 1:51 pm
    Hi again.
    I'm having a coupe of amplitude change issues with the adsr~ unit now, i.e. the familiar clicking noises.
    Firstly, when holding down a note and adjusting the sustain level in [adsr~] there are a sereis of distorted clicks as the amplitude changes. I know why this is happening, but I can't figure out a way to smooth the changes. Everything I've tried ([poly~, rampsmooth~, line etc)results in a signal that [adsr~] can't understand.
    Secondly there is another audible click (more of a thump in this instance) when I start a second envelope. As an example (and remember it's a monosynth!) when I play a note with an amplitude envelope with a long attack, and I press another note interrupting this first envelope the new note thumps loudly first before followiong the envelope set by [adsr~]. Again, I've tried everything I can think of to combat this but to no avail.
    I've included a sine wave monosynth patch which I've been using to try and understand adsr~ - It requires Darwin Grosse's ddg.mono external object.
    Hopefully someone has some ideas!
    Thanks in advance
    Mike
    max v2;

    • Mar 12 2008 | 2:24 pm
      Hey Mike.
      Not too sure about the thumb thing, don't have any prior experience with
      that ddg.mono external either..
      Your sustain problem is easily fixed though.
      In fact, as you see in the tutorials, in all cases with such an amplitude
      changing problem, you can use [line~], not line...
      Example, output your sustain number into a message box containg [$1 50] and
      send that to [line~].
      Now simple output that into the sustain inlet of [adsr~].
      That's one problem down... ;)
      Cheers,
      Lasse
      On Wed, Mar 12, 2008 at 2:51 PM, Michael Field
      wrote:
      >
      > Hi again.
      >
      > I'm having a coupe of amplitude change issues with the adsr~ unit now, i.e.
      > the familiar clicking noises.
      >
      > Firstly, when holding down a note and adjusting the sustain level in
      > [adsr~] there are a sereis of distorted clicks as the amplitude changes. I
      > know why this is happening, but I can't figure out a way to smooth the
      > changes. Everything I've tried ([poly~, rampsmooth~, line etc)results in a
      > signal that [adsr~] can't understand.
      >
      > Secondly there is another audible click (more of a thump in this instance)
      > when I start a second envelope. As an example (and remember it's a
      > monosynth!) when I play a note with an amplitude envelope with a long
      > attack, and I press another note interrupting this first envelope the new
      > note thumps loudly first before followiong the envelope set by [adsr~].
      > Again, I've tried everything I can think of to combat this but to no avail.
      >
      > I've included a sine wave monosynth patch which I've been using to try and
      > understand adsr~ - It requires Darwin Grosse's ddg.mono external object.
      >
      > Hopefully someone has some ideas!
      >
      > Thanks in advance
      > Mike
      >
      > max v2;
      > #N vpatcher 216 67 909 496;
      > #P window setfont "Sans Serif" 9.;
      > #P window linecount 1;
      > #P newex 60 235 27 196617 *~;
      > #P newex 309 120 41 196617 * 0.01;
      > #P flonum 309 148 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
      > #P user dial 308 77 40 40 101 1 0 0 223 270 1 1. 170 170 170 221 221 221
      > 120 120 120 225 225 225 0 0 0 0 0 0;
      > #P user dial 191 77 40 40 101 10 1 0 223 270 1 1. 170 170 170 221 221 221
      > 120 120 120 225 225 225 0 0 0 0 0 0;
      > #P flonum 366 148 41 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
      > #P user dial 366 77 40 40 101 10 0 0 223 270 1 1. 170 170 170 221 221 221
      > 120 120 120 225 225 225 0 0 0 0 0 0;
      > #P flonum 249 148 41 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
      > #P user dial 249 77 40 40 101 10 0 0 223 270 1 1. 170 170 170 221 221 221
      > 120 120 120 225 225 225 0 0 0 0 0 0;
      > #P flonum 191 148 41 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
      > #P newex 166 198 117 196617 adsr~ 10. 100. 0.5 100;
      > #P user gain~ 108 316 38 42 158 0 1.071519 7.94321 10.;
      > #P newex 60 199 61 196617 cycle~ 440;
      > #P user ezdac~ 60 347 104 380 0;
      > #P newex 60 154 31 196617 mtof;
      > #P newex 60 51 51 196617 notein a 1;
      > #P newex 60 84 51 196617 ddg.mono;
      > #P window linecount 18;
      > #P comment 424 60 173 196617 These are the problems I'm having... If you
      > hold down a note and move the sustain knob there are audible clicks due to
      > instant amplitude changes. Is there any way of sorting this? Also , if you
      > set attack up high and then move from one note to another try moving a
      > couple of octaves) you will hear the new note thump loudly before following
      > the envelope. Anyone have any ideas to stop this? Thanks for trying! Mike;
      > #P connect 2 0 1 0;
      > #P connect 1 0 3 0;
      > #P connect 3 0 5 0;
      > #P connect 5 0 17 0;
      > #P fasten 6 0 4 0 113 384 54 384 54 338 65 338;
      > #P fasten 7 0 17 1 171 226 82 226;
      > #P fasten 6 0 4 1 113 384 54 384 54 338 99 338;
      > #P connect 2 1 1 1;
      > #P fasten 17 0 6 0 65 297 113 297;
      > #P fasten 1 1 7 0 106 186 171 186;
      > #P connect 13 0 8 0;
      > #P connect 8 0 7 1;
      > #P connect 10 0 7 2;
      > #P connect 15 0 7 3;
      > #P connect 9 0 10 0;
      > #P connect 12 0 7 4;
      > #P connect 14 0 16 0;
      > #P connect 16 0 15 0;
      > #P connect 11 0 12 0;
      > #P pop;
      >
      > --
      > Mike Field
      > 4th year BA hons Popular Music
      > Napier University
      > Edinburgh
      > Scotland
      >
    • Mar 12 2008 | 2:28 pm
      Mike,
      Here's a modified version of your patch that addresses your questions. First, I scaled the input to adsr~ from 0-127 to the more MSP-friendly 0.-1. Then using line~ smooths the sustain values. Finally sending the "legato 1" message to adsr~ prevents thumping during retriggers. Hope this helps.
    • Mar 12 2008 | 3:50 pm
      Thats brilliant - Thanks for that!
      There's one bit I don't understand though - the unpack stuff going into ddg.mono. What's that all about?
      Thanks
      Mike
    • Mar 13 2008 | 11:12 am
      The unpack into ddg.mono was there for me to test the patch without a keyboard. It just allowed me to send messages such as '60 127' and '60 0' to simulate MIDI input.