Splitting audio into level bands?
Can I split audio into 3 level bands (= ranges of loudness) and put them together again?
The idea is, to have 3 isolated bands, each with a certain level range of the input, manipulate each band and output the combined signal.
An extreme application could be to compress loud parts, filter the middle range and delay silent parts of the signal.
The DAW plugin Neodynium from Elemental Audio did something like this, they had different compressors for different level ranges of the incoming signal.
I do this with MIDI data, but cannot get it working with audio. There are no [split~] and [scale~] objects and when I separate with gates I destroy the signal.
neodynium... just a cheap copy of the famous original. ;) my our the trick is to smooth the control for the different "gates" until any change look like cosines.
that basically happens when the analysis of the input´s power is set to the same (like i call it :) "window size" as the smoothing.
you still have to be a bit careful with faster analysis settings, depending on the material and what you are going to do with the bands, 50 or 100 ms can be already audible. only for dynamics processing this wont happen in an unintended way.
it sucks to upload a bunch of abstractions out of context, let me know when you dont get the picture to work.
110.average is nothing special you can just use the external - all other abstrations can be replaced with something which does why their names say.
first inlet is audio.
proposal for default values: 250 ms, mode rms, -24db, -12db, -6 db.

splitter es simple as possible
you can calc split in db if needed and change ramp / switch time
u cant fade between 1 and 3 that way. :)
oh and while they wont be useful here, if you miss an object, build your own.
split~
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 191 38 48 196617 loadbang;
#B color 12;
#P newex 117 56 48 196617 f $1;
#B color 15;
#P hidden newex 112 117 116 196617 bgcolor 100 100 200;
#N comlet Splitpoint f;
#P inlet 117 28 15 0;
#N comlet <;
#P outlet 18 165 15 0;
#N comlet >;
#P outlet 76 165 15 0;
#N comlet Signal In;
#P inlet 76 28 15 0;
#P newex 18 100 47 196617 +~ 1.;
#P newex 18 126 68 196617 gate~ 2;
#P newex 18 74 48 196617 <~ 0.;
#B color 12;
#P connect 9 0 8 0;
#P connect 1 0 4 0;
#P connect 3 0 0 0;
#P lcolor 6;
#P connect 3 0 1 1;
#P lcolor 6;
#P connect 6 0 0 1;
#P connect 8 0 0 1;
#P connect 1 1 5 0;
#P connect 2 0 1 0;
#P connect 0 0 2 0;
#P window clipboard copycount 10;
scale~
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 21 52 75 196617 clip~ $1 $2;
#B color 2;
#P hidden newex 215 188 116 196617 bgcolor 100 100 200;
#P outlet 21 211 15 0;
#P newex 118 193 37 196617 +~ 0.;
#P newex 21 175 37 196617 *~ 0.;
#P newex 21 144 37 196617 /~ 0.;
#P newex 232 129 37 196617 t b f;
#P newex 232 157 37 196617 - 0.;
#P newex 118 98 37 196617 t b f;
#P newex 118 126 37 196617 - 0.;
#P newex 21 80 37 196617 -~ 0.;
#P inlet 21 30 15 0;
#P inlet 289 30 15 0;
#P inlet 232 30 15 0;
#P inlet 175 30 15 0;
#P inlet 118 30 15 0;
#P newex 358 44 50 196617 loadbang;
#P newex 289 62 50 196617 f $4;
#B color 2;
#P newex 232 62 50 196617 f $3;
#B color 2;
#P newex 175 62 50 196617 f $2;
#B color 2;
#P newex 118 62 50 196617 f $1;
#B color 2;
#P connect 8 0 3 0;
#P connect 4 0 0 0;
#P connect 4 0 1 0;
#P connect 4 0 2 0;
#P connect 4 0 3 0;
#P connect 14 1 13 1;
#P connect 3 0 13 0;
#P connect 14 0 13 0;
#P connect 2 0 17 1;
#P connect 2 0 14 0;
#P connect 7 0 2 0;
#P connect 6 0 1 0;
#P connect 12 1 11 1;
#P connect 16 0 17 0;
#P connect 1 0 11 0;
#P connect 12 0 11 0;
#P connect 0 0 10 1;
#P connect 0 0 12 0;
#P connect 5 0 0 0;
#P connect 13 0 16 1;
#P connect 11 0 15 1;
#P connect 17 0 18 0;
#P connect 15 0 16 0;
#P connect 10 0 15 0;
#P connect 20 0 10 0;
#P connect 9 0 20 0;
#P window clipboard copycount 21;
Thanks to both of you!
I started with Source Audio’s patch because this is easier for me. Of course the ramp time of [matrix~] is crucial. I have to use 100 ms for most material. Sometimes it does still not switch smoothly, only with much longer ramps which tend to smear the audio as expected. Well, there is room for improvement, I will see how far I can take it.
Now I would like to try Roman's patch but cannot build it as I see it.
Roman, could you please confirm/explain the meaning of the objects?
I guess:
[110.db2amp] is now [dbtoa]
[110.ms2samp] is now [translate ms samples]
I think:
[110.loadargs] and [110.defarg] are not necessary when I am not in an abstraction. Do I need something else? (I never made an abstraction yet ...)
I ask:
I don’t find [110.average~] on maxobjects.com, is it Max [average~] or something special?
What is your [p t] ? From the usage it looks like the
Max [trigger] but for both, numbers and signals – correct?
Peter - this fast and cheap splitter was meant to offer easy
splitting to test if processing audio that way makes sense or not.
I would personaly see no use of that, but that does not matter.
You can try to improve both level detector and splitter
using different standard max objects.
Yes, I understand it like this and it helped me for testing. From this experience I tend to believe that hard splitting is not the way to go. I need something softer, dynamically. So far I see from his screenshot, Roman’s abstraction does that.
the average abstraction is a typical "wrap" abstraction; it is really only the external with an extra input for the signal, and the last input takes 0/1 for rms/absolute.
mr. and mrs. [p t] are empty patches to keep connections aligned. i dont like to align connections with breakpoints. when reading the patch, just ignore those.
you seem to got the rest right.
the whole thing is desinged in a way that it just split stuff into bands, which would add up back to the original again when you´d mix them together.
once you get it working (or make your own version) it should be easy to extend it for more bands. personally i use 3, 4, and 10 band versions.
you might also want to dissect the analysis part from the bandsplitter. for example maybe you want to analyse only in mono but process 2 channers? like some hardware compressors do.
if you want to make it a dynamics effect, you´d simply use a *~ on each of the bands.
if you want to make it a dynamic effect with different times for attack and release, you have a think a bit around the corner. i would plan a whole weekende for that.
and while you´re on it, build something like sourceaudio´s proposal (distributing input onto alternative channels based on peak or power), too - it is a bit different, but only when you have both at your hands you can choose the right one.
Ha! It is running and works fine. Musically I like the crossfades between the bands, for me this is often desirable. In this aspect the relatively long smoothing ramp is ok.
I think I get phase problems when I sum the bands. Actually logical, I’m summing identical signals which got multiplied by something. I think I got to do something about.
Source Audio’s method is the second beast, for other applications. I will definitely use both.
Thanks again!