ADSR on any sample

phiol's icon

Hi all

I was wondering if it was possible to have the adsr~ work on a sample like say a bass drum.(my goal is to have a long release on my bass drum or any other drum parts and or samples.)

I have and noticed that the adrs~ only seems to work synths, like shown in the max help files.

The only way I've figured out how to create the illusion that the Bass drum is having a long release is by having a low cycle~ (or any low synth notes), triggered a the same time as the Bd and having the adsr make a slow release on that note.

But still I was wondering if it was possible to have control over the amplitude env. of any sample's (a voice for example), the way you can with a synth.

*Again, by slow release I don't mean a reverb or (echo) effect. More a vibration fade out.

thanks a lot in advance

phil

notyouraveragejoe's icon

You can use the ADSR~ on any audio signal, you just need to multiply it's
outlet with your signal using *~
You'll need to trigger your sample at the same time you trigger the ADSR~
The ADSR~ is triggered using a float between 0 and 1 which states the level
for the ADSR~ to go up to. You also need to trigger the release by sending
it a 0. If you don't want to have to trigger the release and want a 3-stage
envelope, send the ADSR~ maxsustain 0
Hope this helps!

On 06/02/2008, phil wrote:
>
>
> Hi all
>
> I was wondering if it was possible to have the adsr~ work on a sample like
> say a bass drum.(my goal is to have a long release on my bass drum or any
> other drum parts and or samples.)
>
> I have and noticed that the adrs~ only seems to work synths, like shown in
> the max help files.
>
> The only way I've figured out how to create the illusion that the Bass
> drum is having a long release is by having a low cycle~ (or any low synth
> notes), triggered a the same time as the Bd and having the adsr make a slow
> release on that note.
>
> But still I was wondering if it was possible to have control over the
> amplitude env. of any sample's (a voice for example), the way you can with a
> synth.
>
> *Again, by slow release I don't mean a reverb or (echo) effect. More a
> vibration fade out.
>
> thanks a lot in advance
>
> phil
>

jvkr's icon

> But still I was wondering if it was possible to have control over the amplitude env. of any sample's...
>
> *Again, by slow release I don't mean a reverb or (echo) effect. More a vibration fade out.

Reading your description, there seems to be an expectation of adsr~ actually modifying the sample. That with a short BD sample, applying a long release, adsr~ actually would add one. The object however works by subtracting, not adding. It fades what is there in the first place.

This said, the low cycle you suggest is the way to go.

_
johan

Stefan Tiedje's icon

phil schrieb:
> But still I was wondering if it was possible to have control over the
> amplitude env. of any sample's (a voice for example), the way you can
> with a synth.

You can build your own adsr~ with line~. If your fast decaying bass drum
still has some sound in it, you could instead of lowering the volume
also amplify it. But it will also raise the noise, and if the signal is
zero even an amplification by 1000 dB will not create any sound. (And a
little noise will blow the speakers and your ears, be carefull... ;-)

try a [1, $1 1000] -> [line~] -> [*~]. And experiment with the
amplification value. But the sample needs to be long enough and needs to
have sufficient audio content which can be ambplified...

Stefan

--
Stefan Tiedje------------x-------
--_____-----------|--------------
--(_|_ ----|-----|-----()-------
-- _|_)----|-----()--------------
----------()--------www.ccmix.com

phiol's icon

Thanks a lot to all of you for the fast response.

I will give a try to all of these options and get back to you. (I am presently away from my computer).

Again, one question still boggles me, how does the amplitude env. work w. a midi sample.
But the source of that note, what is it and where does it come from?

And last, how come when I play with the RELEASE knob on a synth, there is decay in the sound when release is not at max. Is there a ramp in the programming??

Again, many thanks to you all for being my teachers

phil

dlehrich@gmail.com's icon

Hi Phil,

Your confusion is understandable... this stuff is difficult at first and it used to boggle my mind. It *does* get clearer with time...

It's important to keep in mind that MIDI is NOT audio. Midi is just a set of instructions that can be used to drive the playback of audio (or, in Max/MSP/Jitter... lights or videos or many other things...)

On your synthesizer... you are playing with synth sounds that are being generated by oscillators. These oscillators are typically producing periodic waveforms (sine waves, triangle waves, etc.) that cycle endlessly. So... when you play your synth, you are starting the playback of a synthetic "noise" that could theoretically play forever. When you adjust the release, you are adjusting how long it will take to fade out the playback of this "endless" tone.

Now, when you are using MIDI to trigger samples (like your bass drum)... what you are doing is controlling the playback of a pre-recorded piece of audio. If the recording of that bass drum is 1 second long... it's going to take that long to playback unless you adjust the playback rate somehow. You can set the Release time to a minute and it won't matter because there's no audio there to be heard. It's the equivalent of taking your audio file into ProTools, adding a minute of silence to the end of the file, and then merging and saving it out as one long file. Sure, it's a minute long... but there's nothing there to playback.

Hope that helps,
/dan

Quote: philippehughes@hotmail.com wrote on Wed, 06 February 2008 17:45
----------------------------------------------------
>
> Again, one question still boggles me, how does the amplitude env. work w. a midi sample.
> But the source of that note, what is it and where does it come from?
>
> And last, how come when I play with the RELEASE knob on a synth, there is decay in the sound when release is not at max. Is there a ramp in the programming??
>
>
> Again, many thanks to you all for being my teachers
>
> phil
>
>
----------------------------------------------------

phiol's icon

Thanks a lot for the insights Dan. It further clears things up.

Although , I did know that max was midi and more precisely that midi acts as a controller of sounds.
Now the reason I get things confused is; what generates the sounds of these oscillators? Msp right??

So these oscillators are actually samples in msp are they not??

If yes, they is why I'm thinking of replacing theses osc. samples by any samples whatesoever. (bass drum would be one). Then control the amp env. of that sound. And thought it would work the same.

>When you adjust the release, you are adjusting how long it will take to fade out the playback of this "endless" tone.

SO there is a ramp on release.

>So... when you play your synth, you are starting the playback of a synthetic "noise" that could theoretically play forever.

This phrase is key for clearing things up for me. (but still what creates that noise? electrical wave whipping the air!? or samples as it is the case of MSP?)

So, in other words I would need my sample of anything that would theoretically play forever. I can achieve this w. fft. I have downloaded a patch of a phase vocoder that "freezes" your sample.(Which is really neat in itself). But forget about your sample's original timbre. (That's the only thing w. fft. and time stretch.)

But none the less, sticking to the theory of osc., I would freeze and then use a bpfunction w. line~ / [*~] to create that long release.

So basically my only option is reverb? But then again as w. fft, my timbre is altered.

many thanks

phil

dlehrich@gmail.com's icon

No. These oscillators generate sound waves using mathematical equations (like a sine wave). This is different from a "sample" as you describe it, which is an audio computer that is played by teh computer. The name synthesizer comes from the idea that the sounds are "synthesized" (i.e. created) by the machine.

Quote: philippehughes@hotmail.com wrote on Wed, 06 February 2008 23:04
----------------------------------------------------
>
> So these oscillators are actually samples in msp are they not??
>

phiol's icon

thanks for clearing that up.
My curtis roads books is one the way! ;)
Are there any other you suggest??

So it is a signal, waving sinusoidally

It's neat how they achieved creating fake but really close to piano sounds w. maths.

I apoligize for my ignorance, but one is going to bed less ignorant tonight.

thanks again!

phil

DonK's icon

Playing around and learning how modular synths work has helped me immensely in understanding what's going on with audio and control signals (and ADSR, pulse width modulation, etc) and how the theory applies in Max. I'm practically a Max virgin, but playing around with the real world hardware and patching cables seems to help me understand how Max works.
I would highly recommend at least tinkering with hardware synths to help learn audio vs control signals. It's helping me at least.

Stefan Tiedje's icon

phil schrieb:
> It's neat how they achieved creating fake but really close to piano
> sounds w. maths.

Well, most synthesizers are nowadays also sample players (if it sounds
realistically like a piano its probably a sample). But these samples are
usually looped, and kind of normalised. In the loop the decay would not
happen without envelope. You can do the same with your bass drum, if you
place loop points with an editor like Peak, you can read those with
info~ and adjust your sample playback accordingly...
(It would be harder to find good loop point just by hand...)

Sound tweaking in a sample editor is a required skill for this
profession. The only way to learn it, is to do it and train it by
doing... ;-)

An appropriate freeware open source editor would be Audacity...

Good luck, you'll have fun...

Stefan

--
Stefan Tiedje------------x-------
--_____-----------|--------------
--(_|_ ----|-----|-----()-------
-- _|_)----|-----()--------------
----------()--------www.ccmix.com

phiol's icon

thanks for the advice.
since my max msp beginning (last 6 months or so), my focus has mostly been on creating patches that involve interesting sound manipulation (gestures) and taking advantage of the automations aspects that this software permits. Thus, stuff like auto-genretions/algorithms ...

I have build a few basic Fm synths, but again my focus as been more on interesting triggering gestures.

Again, thanks for the hints.

phil

phiol's icon

Hi stefan

I'm just a little confused on what a few things you wrote;

>these samples are usually looped, and kind of normalised.
What do you mean by normalised. Constant ? or every sample is of the same lenght? (piano note for example).

>if you place loop points with an editor like Peak, you can read those with info~ and adjust your sample playback accordingly...

By loop points you do of course mean start and end? Why would we need Peak? Can't we obtain them w. groove~ and place the loop points by hand w. [waveform display]. Sorry, don't want to be annoying, just curious.

>Sound tweaking in a sample editor is a required skill for this
profession. The only way to learn it, is to do it and train it by
doing... ;-)

I've been using logic express, do you think it a good sample editor or is audicity better. Or is it all the same and this just a stpid question !!

thanks stefan

phil

Ignotus's icon

If you are going to apply attack-decay-sustain-release envelopes to a
sampled sound, independent of using the adsr~ object, take a look at groove~
and looping.

As was already remarked, you can use line~ to control amplitude of a sample.

If a sampled sound has loop points, you can apply the A and D amplitude
control when the sound is triggered, maintain the S amplitude over the loop,
and apply the R falloff when the sound is released. Trigger could be a MIDI
on message, sustain will happen simply when the sampled sound reaches the
loop, and release could be a MIDI off message. Of course, mouse events or
any other type of control input could do this, too.

There should be plenty of material in the tutorials.

-- Paul

On Feb 7, 2008 2:42 AM, phil wrote:

>
> thanks for clearing that up.
> My curtis roads books is one the way! ;)
> Are there any other you suggest??
>
>
> So it is a signal, waving sinusoidally
> equations. And this would be the frequency we hear.
>
> It's neat how they achieved creating fake but really close to piano sounds
> w. maths.
>
>
> I apoligize for my ignorance, but one is going to bed less ignorant
> tonight.
>
>
> thanks again!
>
> phil
>

--
----- |(*,+,#,=)(#,=,*,+)(=,#,+,*)(+,*,=,#)| -----

Stefan Tiedje's icon

phil schrieb:
> I'm just a little confused on what a few things you wrote;
>
>> these samples are usually looped, and kind of normalised.
> What do you mean by normalised. Constant ? or every sample is of the
> same lenght? (piano note for example).

They have different lengths but the same (peak)level (0dB). That means
if you amplify them you over load your converters...

> By loop points you do of course mean start and end? Why would we need
> Peak? Can't we obtain them w. groove~ and place the loop points by
> hand w. [waveform display]. Sorry, don't want to be annoying, just
> curious.

Of course you can do that by hand, but in an editor like peak its much
more convenient, as they have to be set precise to avoid clicks. An
editor is made for this kind of work. If you want to create the same
functionality in Max (its definitely possible), you have to patch alot,
for example you need to zoom and still keep loop points and alike. You
would want to put the loop points at zero crossings for example and you
have to zoom in a lot to see them....

> I've been using logic express, do you think it a good sample editor
> or is audicity better. Or is it all the same and this just a stpid
> question !!

It is not at all a stupid question.
Though I don't know logic express, I guess you could do it in there. But
as logic is more a sequencer/DAW I am not sure if you could save the
result in a format that contains the loop points. You can always write
them on a paper and then set them in Max...
But what I was refering to is just editing practice. Learn how a
waveforms look like compared to how it sounds etc...
As soon you start working on it, you will notice if your tool will fit
or not. Any tool is a good starting point. Audacity is just a no
brainer, as its free and thus also risk free... ;-)

Stefan

--
Stefan Tiedje------------x-------
--_____-----------|--------------
--(_|_ ----|-----|-----()-------
-- _|_)----|-----()--------------
----------()--------www.ccmix.com