Forums > MaxMSP

amplitude envelopes using a pitch tracker

February 3, 2007 | 7:36 pm

Hi Everyone,

I have been using Tristan Jehan’s pitch~ object to track the input
pitch from my bass guitar. Cycle~ then outputs a sine wave at the same
pitch. The amplitude envelope is set using ‘breakpoint’ (see example),
but I am wondering: is there any way to ‘track’ the amplitude envelope
of the bass guitar directly?

Thank you,

-Tim

max v2;
#N vpatcher 0 0 1280 720;
#P user ezdac~ 629 422 673 455 0;
#N vpreset 9;
#P preset 661 79 36 37;
#P user function 737 183 837 233 0 1 0 0;
#X frgb 82 82 82;
#X brgb 204 204 204;
#X rgb2 85 85 85;
#X rgb3 255 255 255;
#X rgb4 0 0 0;
#X rgb5 0 0 0;
#X add 0. 0. 0;
#X add 45.454548 1. 0;
#X add 500. 0.04 0;
#X domain 2000.;
#X range 0. 1.;
#X done;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 657 337 30 9109513 line~;
#P newex 640 367 27 9109513 *~;
#P number 641 174 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 641 302 36 9109513 cycle~;
#P inlet 737 82 15 0;
#P newex 769 34 45 9109513 loadbang;
#P message 806 64 30 9109513 11.6;
#P flonum 806 82 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 769 63 26 9109513 512;
#P number 769 82 35 9 0 8188 3 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 843 64 58 9109513 Hop size;
#P comment 796 261 37 9109513 up to 3;
#P comment 938 261 37 9109513 up to 3;
#P button 737 136 23 0;
#P window linecount 2;
#P message 967 325 62 9109513 65.390778 57.2;
#P window linecount 1;
#P newex 967 305 60 9109513 prepend set;
#P window linecount 2;
#P message 903 325 62 9109513 69.084084 42.142391;
#P window linecount 1;
#P newex 903 305 60 9109513 prepend set;
#P newex 930 275 50 9109513 route 1 2;
#P comment 894 355 144 9109513 Polyphonic pitches (freq , amp);
#P flonum 589 174 49 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 589 142 62 9109513 unpack 0. 0.;
#P window linecount 2;
#P message 1174 325 69 9109513 660.716858 0.082795;
#P window linecount 1;
#P newex 1174 305 60 9109513 prepend set;
#P window linecount 2;
#P message 1108 325 64 9109513 439.653534 0.125317;
#P window linecount 1;
#P newex 1108 305 60 9109513 prepend set;
#P newex 1092 276 59 9109513 route 1 2 3;
#P window linecount 2;
#P message 1042 325 64 9109513 221.124832 0.245329;
#P window linecount 1;
#P newex 1042 305 60 9109513 prepend set;
#P window linecount 2;
#P message 841 203 66 9109513 57.038849 109.21067;
#P window linecount 1;
#P newex 841 183 60 9109513 prepend set;
#P window linecount 2;
#P message 827 325 63 9109513 65.390778 357.2;
#P window linecount 1;
#P newex 827 305 60 9109513 prepend set;
#P window linecount 2;
#P message 762 325 63 9109513 69.084091 442.142395;
#P window linecount 1;
#P newex 762 305 60 9109513 prepend set;
#P newex 789 275 50 9109513 route 1 2;
#P flonum 893 136 49 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 737 111 219 9109513 pitch~ 2048 512 4096 blackman70 0 1 10 3;
#B color 6;
#P comment 881 153 72 9109513 Amplitude (dB);
#P comment 1039 355 207 9109513 Individual sinusoidal components (freq
, amp);
#P comment 753 355 139 9109513 Polyphonic pitches (MIDI , Hz);
#P comment 644 194 52 9109513 Pitch (Hz);
#P window linecount 3;
#P comment 846 232 53 9109513 Raw MIDI pitch and amplitude;
#P window linecount 1;
#P comment 601 120 36 9109513 Cooked;
#P comment 1100 262 51 9109513 up to 100;
#P comment 731 161 35 9109513 Attack;
#P connect 8 1 24 0;
#P connect 24 0 25 0;
#P connect 44 0 48 0;
#P connect 42 0 44 0;
#P connect 24 1 43 0;
#P connect 43 0 42 0;
#P fasten 46 1 45 0 772 274 662 274;
#P connect 45 0 44 1;
#P connect 44 0 48 1;
#P fasten 36 0 8 0 774 104 742 104;
#P fasten 38 0 8 0 811 104 742 104;
#P connect 41 0 8 0;
#P connect 8 0 32 0;
#P connect 32 0 46 0;
#P connect 47 0 46 0;
#P fasten 10 0 11 0 794 298 767 298;
#P connect 11 0 12 0;
#P connect 40 0 37 0;
#P hidden connect 37 0 36 0;
#P connect 8 1 10 0;
#P connect 40 0 39 0;
#P hidden connect 39 0 38 0;
#P fasten 10 1 13 0 814 298 832 298;
#P connect 13 0 14 0;
#P fasten 8 2 15 0 846 174 846 174;
#P connect 15 0 16 0;
#P connect 8 3 9 0;
#P fasten 27 0 28 0 935 298 908 298;
#P connect 28 0 29 0;
#P fasten 8 2 27 0 846 177 935 177;
#P fasten 27 1 30 0 955 298 972 298;
#P connect 30 0 31 0;
#P fasten 19 0 17 0 1097 298 1047 298;
#P connect 17 0 18 0;
#P fasten 8 4 19 0 950 136 1097 136;
#P connect 19 1 20 0;
#P connect 20 0 21 0;
#P fasten 19 2 22 0 1129 298 1179 298;
#P connect 22 0 23 0;
#P pop;


February 3, 2007 | 8:56 pm

Hi Tim,

Here’s a basic envelope follower you can insert into your patch.
Nothing fancy, but gets the job done.

Good luck,

Steven

On Feb 3, 2007, at 12:36 PM, tflood@umich.edu wrote:

> Hi Everyone,
>
> I have been using Tristan Jehan’s pitch~ object to track the input
> pitch from my bass guitar. Cycle~ then outputs a sine wave at the
> same pitch. The amplitude envelope is set using ‘breakpoint’ (see
> example), but I am wondering: is there any way to ‘track’ the
> amplitude envelope of the bass guitar directly?
>

max v2;
#N vpatcher 0 44 560 330;
#P window setfont "Sans Serif" 10.;
#P window linecount 8;
#P comment 373 48 117 196618 Optional argument – length of averaging
in sample – default 100. Common useful values range between 100 &
2000 , depending on transient nature of incoming signal.;
#P window linecount 4;
#P comment 239 173 118 196618 Outlet – signal representing amplitude
envelope of input signal.;
#P window linecount 3;
#P comment 239 117 118 196618 Right inlet – float value sets length
of averaging in samples.;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 157 87 56 196617 sel 0;
#P newex 157 67 44 196617 i $1;
#P newex 157 47 54 196617 loadbang;
#P message 157 107 37 196617 100.;
#N comlet (float) smoothing factor in samples;
#P inlet 123 47 15 0;
#N comlet (signal) averaged peak amplitude of input signal;
#P outlet 47 188 15 0;
#N comlet (signal) input signal;
#P inlet 47 47 15 0;
#P newex 47 149 86 196617 slide~;
#P newex 47 107 28 196617 abs~;
#P window setfont "Sans Serif" 10.;
#P window linecount 4;
#P comment 239 48 118 196618 Left inlet – audio signal to be analyzed
for amplitude envelope.;
#P connect 3 0 1 0;
#P connect 1 0 2 0;
#P connect 2 0 4 0;
#P fasten 9 1 2 1 208 129 90 129;
#P fasten 6 0 2 1 162 129 90 129;
#P fasten 5 0 2 1 128 129 90 129;
#P fasten 9 1 2 2 208 129 128 129;
#P fasten 6 0 2 2 162 129 128 129;
#P fasten 5 0 2 2 128 99 128 99;
#P connect 7 0 8 0;
#P connect 8 0 9 0;
#P connect 9 0 6 0;
#P pop;

—-
Steven M. Miller

http://pubweb.csf.edu/~smill
SFIFEM
Atrium Sound Space
OVOS


February 3, 2007 | 9:17 pm

At 2:36 PM -0500 2/3/07, tflood@umich.edu wrote:
>I have been using Tristan Jehan’s pitch~ object to track the input pitch from my bass guitar. Cycle~ then outputs a sine wave at the same pitch. The amplitude envelope is set using ‘breakpoint’ (see example), but I am wondering: is there any way to ‘track’ the amplitude envelope of the bass guitar directly?

I’m on an Intel Mac, so I can’t test pitch~, but I bet the amplitude output of pitch~ is pretty close to what you need. You may want to do some smoothing or other integration on it, but it should be in the ballpark.

-C


Chris Muir | "There are many futures and only one status quo.
cbm@well.com | This is why conservatives mostly agree,
http://www.xfade.com | and radicals always argue." – Brian Eno


February 3, 2007 | 9:18 pm


September 2, 2007 | 11:11 pm

I am very new to Max/MSP but have been interested in using a pitch tracker as well. I know this is VERY basic, but i had a question regarding the patches that have been posted, when I open the patch in Max/MSP and there is an inlet and an outlet at either end of the patch, how do I go about sending my guitar signal/line in to the patch to make a sound? I tried using the patches from this thread in a sub patch but i think i’m just a little confused about this. Thank you all for your help in advance!

Best,
Julian


September 3, 2007 | 2:13 am

personally i would use adc~ for input and output using a
signal level fader to dac~

Luggage? GPS? Comic books?
Check out fitting gifts for grads at Yahoo! Search

http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz


September 3, 2007 | 8:14 pm

Quote: Chris Muir wrote on Sat, 03 February 2007 13:17
—————————————————-
> At 2:36 PM -0500 2/3/07, tflood@umich.edu wrote:
> >I have been using Tristan Jehan’s pitch~ object to track the input pitch from my bass guitar. Cycle~ then outputs a sine wave at the same pitch. The amplitude envelope is set using ‘breakpoint’ (see example), but I am wondering: is there any way to ‘track’ the amplitude envelope of the bass guitar directly?
>
> I’m on an Intel Mac, so I can’t test pitch~, …
—————————————————-

Sure you can; UB version here:

http://web.media.mit.edu/~tristan/maxmsp.html

mz


September 4, 2007 | 6:48 pm

Chubb schrieb:
> personally i would use adc~ for input and output using a
> signal level fader to dac~

I’d personally just recommend to read the tutorials…
(Things which are too basic provoke it… ;-)

Stefan


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


September 4, 2007 | 6:58 pm

Quote: Stefan Tiedje wrote on Tue, 04 September 2007 12:48
—————————————————-
> Chubb schrieb:
> > personally i would use adc~ for input and output using a
> > signal level fader to dac~
>
> I’d personally just recommend to read the tutorials…
> (Things which are too basic provoke it… ;-)
>
> Stefan

at least you did not recommend to "do it with java", this time.

-110


September 6, 2007 | 11:48 pm

snapshot~ on the adc~ ?


Viewing 10 posts - 1 through 10 (of 10 total)