Audio signal summation and level meters?

Mar 1, 2008 at 9:12pm

Audio signal summation and level meters?

I’m working on a 16 channel 16step pulse sequencer (based on Chris Muir’s sample patch). It’s working great. But when I add all the channels together, I’m afraid my levels are getting way too hot. Here’s how the channels are added together.

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P hidden newex 486 483 27 196617 *~;
#P hidden newex 371 483 107 196617 poly~ samplerVoice 4;
#P user gain~ 732 429 50 101 158 0 1.071519 7.94321 10.;
#P hidden newex 751 592 90 196617 dac~;
#P hidden newex 486 466 27 196617 *~;
#P hidden newex 371 464 107 196617 poly~ samplerVoice 4;
#P hidden newex 486 447 27 196617 *~;
#P hidden newex 371 444 107 196617 poly~ samplerVoice 4;
#P hidden newex 486 427 27 196617 *~;
#P hidden newex 371 424 107 196617 poly~ samplerVoice 4;
#P hidden newex 486 407 27 196617 *~;
#P hidden newex 485 385 27 196617 *~;
#P hidden newex 485 363 27 196617 *~;
#P hidden newex 484 341 27 196617 *~;
#P hidden newex 371 404 107 196617 poly~ samplerVoice 4;
#P hidden newex 371 383 107 196617 poly~ samplerVoice 3;
#P hidden newex 604 409 26 196617 +=~;
#P hidden newex 370 363 107 196617 poly~ samplerVoice 2;
#P hidden newex 370 342 107 196617 poly~ samplerVoice 1;
#P hidden connect 0 0 5 0;
#P hidden connect 1 0 6 0;
#P hidden connect 3 0 7 0;
#P hidden connect 4 0 8 0;
#P hidden connect 9 0 10 0;
#P hidden connect 11 0 12 0;
#P hidden connect 13 0 14 0;
#P hidden connect 17 0 18 0;
#P hidden connect 6 0 2 0;
#P hidden connect 7 0 2 0;
#P hidden connect 8 0 2 0;
#P hidden connect 10 0 2 0;
#P hidden connect 12 0 2 0;
#P hidden connect 14 0 2 0;
#P hidden connect 5 0 2 0;
#P hidden connect 18 0 2 0;
#P hidden connect 2 0 16 0;
#P hidden connect 16 0 15 0;
#P hidden connect 16 0 15 1;
#P window clipboard copycount 19;

I know there must be a better way. I tried the normalize~ object, but I just don’t get it. :(

Is there a “best way” to sum up audio signals in MSP?

Also, I can’t get a meter working (so I can check my levels before sending it out of the computer). Could someone maybe show me how that’s done too?

I’ve only been using Max a few months, but this forum is great and I’m having fun learning. Thanks for everyone’s help here.

-Don

#36142
Mar 1, 2008 at 9:15pm

Oops, here’s the more complete summation I’m doing.

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P hidden newex 182 316 27 196617 *~;
#P hidden newex 7 163 107 196617 poly~ samplerVoice 4;
#P flonum 300 159 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user gain~ 350 414 50 101 158 0 1.071519 7.94321 10.;
#P hidden newex 369 577 90 196617 dac~;
#P hidden newex 182 299 27 196617 *~;
#P hidden newex 7 144 107 196617 poly~ samplerVoice 4;
#P flonum 300 143 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P hidden newex 182 280 27 196617 *~;
#P hidden newex 7 124 107 196617 poly~ samplerVoice 4;
#P flonum 300 127 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P hidden newex 182 260 27 196617 *~;
#P flonum 300 111 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P hidden newex 7 104 107 196617 poly~ samplerVoice 4;
#P hidden newex 182 240 27 196617 *~;
#P hidden newex 181 218 27 196617 *~;
#P flonum 300 95 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 300 79 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P hidden newex 181 196 27 196617 *~;
#P hidden newex 180 174 27 196617 *~;
#P flonum 300 63 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 300 47 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P hidden newex 7 84 107 196617 poly~ samplerVoice 4;
#P hidden newex 7 63 107 196617 poly~ samplerVoice 3;
#P hidden newex 354 372 26 196617 +=~;
#P hidden newex 6 43 107 196617 poly~ samplerVoice 2;
#P hidden newex 6 22 107 196617 poly~ samplerVoice 1;
#P hidden connect 23 0 22 0;
#P hidden connect 23 0 22 1;
#P hidden connect 2 0 23 0;
#P hidden connect 26 0 2 0;
#P hidden connect 7 0 2 0;
#P hidden connect 21 0 2 0;
#P hidden connect 18 0 2 0;
#P hidden connect 15 0 2 0;
#P hidden connect 12 0 2 0;
#P hidden connect 11 0 2 0;
#P hidden connect 8 0 2 0;
#P hidden connect 24 0 26 1;
#P hidden connect 19 0 21 1;
#P hidden connect 16 0 18 1;
#P hidden connect 14 0 15 1;
#P hidden connect 10 0 12 1;
#P hidden connect 9 0 11 1;
#P hidden connect 6 0 8 1;
#P hidden connect 5 0 7 1;
#P hidden connect 25 0 26 0;
#P hidden connect 20 0 21 0;
#P hidden connect 17 0 18 0;
#P hidden connect 13 0 15 0;
#P hidden connect 4 0 12 0;
#P hidden connect 3 0 11 0;
#P hidden connect 1 0 8 0;
#P hidden connect 0 0 7 0;
#P window clipboard copycount 27;

#123799
Mar 2, 2008 at 12:02am

multiply all of your signals by 1 / # of signals. In your example, multiply by 1/8 or 0.125. Its easiest to just sum all of the signals with one *~ box-

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 597 321 23 196617 bad;
#P user ezdac~ 340 252 384 285 0;
#P user meter~ 596 301 676 314 50 0 168 0 103 103 103 255 153 0 255 0 0 217 217 0 153 186 0 12 3 3 3 3;
#P newex 596 244 35 196617 *~ 1.;
#P flonum 113 245 89 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user meter~ 84 301 164 314 50 0 168 0 103 103 103 255 153 0 255 0 0 217 217 0 153 186 0 12 3 3 3 3;
#P button 101 161 15 0;
#P newex 596 80 67 196617 cycle~ 1000;
#P newex 522 80 67 196617 cycle~ 1000;
#P newex 449 80 67 196617 cycle~ 1000;
#P newex 375 80 67 196617 cycle~ 1000;
#P newex 305 80 67 196617 cycle~ 1000;
#P newex 231 80 67 196617 cycle~ 1000;
#P newex 158 80 67 196617 cycle~ 1000;
#P newex 84 80 67 196617 cycle~ 1000;
#P newex 101 188 60 196617 loadmess 8;
#P newex 101 216 31 196617 !/ 1.;
#P newex 84 244 27 196617 *~;
#P comment 91 320 30 196617 good;
#P fasten 11 0 1 0 601 126 89 126;
#P fasten 11 0 15 0 601 170 601 170;
#P fasten 10 0 1 0 527 126 89 126;
#P fasten 10 0 15 0 527 126 601 126;
#P fasten 9 0 1 0 454 126 89 126;
#P fasten 9 0 15 0 454 126 601 126;
#P fasten 8 0 1 0 380 126 89 126;
#P fasten 8 0 15 0 380 126 601 126;
#P fasten 7 0 1 0 310 126 89 126;
#P fasten 7 0 15 0 310 126 601 126;
#P fasten 6 0 1 0 236 125 89 125;
#P fasten 6 0 15 0 236 126 601 126;
#P fasten 5 0 1 0 163 126 89 126;
#P fasten 5 0 15 0 163 126 601 126;
#P fasten 4 0 1 0 89 170 89 170;
#P fasten 4 0 15 0 89 126 601 126;
#P connect 2 0 1 1;
#P fasten 2 0 14 0 106 239 118 239;
#P connect 15 0 16 0;
#P connect 1 0 13 0;
#P connect 12 0 3 0;
#P connect 3 0 2 0;
#P window clipboard copycount 19;

#123800
Mar 2, 2008 at 6:40pm

Nick Inhofe schrieb:
> multiply all of your signals by 1 / # of signals. In your example,
> multiply by 1/8 or 0.125. Its easiest to just sum all of the signals
> with one *~ box-

This is a pretty bad advice, as it might be ok for two, but for more it
will create much too low volume. If the signals are not correlated or
syncronized, the likelyhood that all voices will show the maximum level
at the same time is fast going to zero, this theoretical possibilty has
no practical relevance…

Usually each doubling of voices needs a decrease of 3 dB. But I wouldn’t
bother at all. It’s much easier to just place a volume control before
the dac~s. Let your ear decide…

Internally you just can’t clip, it will never… The volume control as
last pass is all you need…

By the way, the patch posted showed a lack of knowledge about the
principle of poly~… I think the help file and the tutorials should be
enough to get an idea what poly~ is about, just take your time and
experiment…

Stefan


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

#123801
Mar 2, 2008 at 11:29pm

Thanks Nick and Stefen.

Nick’s method is working well enough for the patch, but I was wondering about what Stefan brought up about it getting quiet.

Thanks for the technical info and advice, Stefan.

I’m still learning Max, still slowly going through tutorials, going off on a tangent for a while, then going back to where I left off in the tutorial, and repeat. So far, the “ah ha!” moments have come when I finally figure out what an object is capable of doing, but I’m still waiting for the “ah ha” for poly~. The instancing and voice allocation is still a bit confusing. But I just started playing around with poly this least week.

At my current rate of an object per week, I should finish learning max some time in the 22nd century. :)

I had a feeling I was using poly incorrectly…now I have to figure it out.

#123802
Mar 3, 2008 at 12:16am

On Mar 2, 2008, at 3:29 PM, Don K wrote:

> I had a feeling I was using poly incorrectly…now I have to figure
> it out.

I have a couple of simple examples of ways to use poly on my examples
page:

http://www.xfade.com/max/examples

Chris Muir
cbm@well.com

#123803
Mar 3, 2008 at 12:39am

Stefan has a good point. I made the post quickly, without thinking about it too much. Obviously, the best method is to just mix with your ears! If you have a lot of different sound sources which aren’t necessarily going to be playing at the exact same time, its just a matter of balance.

However, for something like the example I gave where you have multiple oscillators going at the same time, its a good quick fix to just multiply by the reciprocal of the number of oscs you have.
It is better to mix each individually though, and have more control over timbre!

#123804
Mar 5, 2008 at 6:54am

Don K schrieb:
> At my current rate of an object per week, I should finish learning
> max some time in the 22nd century. :)

Don’t worry, a steep learning curve is exponential, you will accelerate,
that’s a law of nature…

> I had a feeling I was using poly incorrectly…now I have to figure
> it out.

You just have to know, that you need a single poly~ for 25 voices. Only
if you boost the number of voices into the hundreds and thousands, you
will need more, but they have to be on different computers then… ;-)

And as I said before, experimenting is the key to learning. Most
questions can Max answer itself, as soon as you learned how to pose a
question to Max, your learning curve will accelerate faster than
exponential… ;-)

Good luck, you’ll have fun…

Stefan


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

#123805
Mar 5, 2008 at 10:44am

> You just have to know, that you need a single poly~ for 25 voices. Only
> if you boost the number of voices into the hundreds and thousands, you
> will need more,

The limit to one poly~ is 1024.

> but they have to be on different computers then… ;-)

Unless they use little or no cpu, like my beautiful printpol abstraction I just made, that prints voice numbers upon instantiation. :)

_
johan

#123806
Mar 5, 2008 at 7:56pm

Quote: Stefan Tiedje wrote on Tue, 04 March 2008 22:54
—————————————————-

>
> And as I said before, experimenting is the key to learning. Most
> questions can Max answer itself, as soon as you learned how to pose a
> question to Max, your learning curve will accelerate faster than
> exponential… ;-)
>
> Good luck, you’ll have fun…

I think I understand poly~ a little more. Is it basically an instance of a subpatch that is created when I play a note (or max plays a note), then is deleted from memory when the note finishes? Sort of like the poly~ object tells the computer to use a subpatch (which may or may not made audio, but usually is audio), it does it’s thing and poly~ is is a creator and destroyer of subpatch usage? Kinda, sorta…?

I’m finally comfortable enough with Max to start exploring a bit, and yes, it’s been loads of fun. I had an aha moment last night about how I should structure more complex patches. I’ve been making spaghetti til now. :)

Thanks for the encouragement and help to everyone posting in this thread.

#123807

You must be logged in to reply to this topic.