amp envelope analysis for later synthesis

Eric Sheffield's icon

Hello, all.
I'm working on a piece for percussionist and electronic performer, and am trying to figure out some interesting ways to create sounds. (this is part of an undergraduate research grant)
The idea is for the electronic sounds to be modeled after the live player's acoustic instruments.
Originally, I was recording samples of each of the instruments to be altered in Max and and played back via a MIDI drum pad. This works OK for my purposes, but I was starting to look into actual synthesis as well.
What I would like to do is have Max analyze the sound of each instrument (this can be done ahead of time before the performance) in order to reproduce facsimiles triggered by the electronic performer. I know how to analyze the pitch material, but now I'm looking at getting the amplitude envelope. I've seen patches for envelope following, but how can I have Max listen to a sound once and remember that amplitude envelope for later synthesis? The way I'm designing the piece, it's OK if the data needs to be edited ahead of time.
Thanks.

seejayjames's icon

Look into peakamp~ at a high resolution (say 20 ms) and record the data (amplitude values) coming out of there. You can send this (with an increasing index value provided by a counter) into a bpfunction or table to store the curve. You could also analyze each sample of your recorded wave using index~ but that's probably a lot more resolution than you need. Or use index~ but only every 100 samples or so, tweak to fit.

The amplitude part is easy compared to the pitch stuff, generally, so you're well on your way.

--CJ

Peter McCulloch's icon

For capturing a percussive sound envelope, I like the following:

audio signal
|
abs~
|
*~ 2.5
|
slide~ 200 2500

Slide gives you log following, and the fast attack time works
substantially better than average~, which tends to round off
attacks. You can use this with *~ to add percussive attacks to a
sustained signal.

Peter McCulloch

Eric Sheffield's icon

Hmmm...
Okay, this is good help, but I think I came across as more knowledgeable than I really am.
The pitch analysis is being done with help from one of my teachers.
I'm not sure how to store these values and then spit them back out later. At least not while retaining the correct timing of the envelope. Any suggestions? I'm planning on doing the work myself, but need a little direction.
Thanks!

Stefan Tiedje's icon

Eric Sheffield schrieb:
> Hmmm... Okay, this is good help, but I think I came across as more
> knowledgeable than I really am. The pitch analysis is being done with
> help from one of my teachers. I'm not sure how to store these values
> and then spit them back out later. At least not while retaining the
> correct timing of the envelope. Any suggestions? I'm planning on
> doing the work myself, but need a little direction.

Should be straight with seq~....

Stefan

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