Forums > MaxMSP

Microphone to slider issue [patch included]

October 17, 2007 | 5:26 pm

Hey all,

I’m having an issue with a slider.

Basically, I want to recieve audio and translate the signal so that it moves a slider. I’ve tried to solve it one of two ways:

A) By multiplying the signal number and changing the settings on the slider from 0-99

B) Changing the slider’s settings to go from 0-1

The issue is that on both occassions, the slider either turns all the way on or all the way off. I want it to hit all the little numbers inbetween. Any advice?

#P user gain~ 93 241 24 100 2 0 0. 0.1 10.;
#P window setfont "Sans Serif" 9.;
#P flonum 93 203 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user meter~ 93 80 116 171 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 window linecount 1;
#P newex 93 36 31 196617 adc~;
#P connect 2 0 3 0;
#P connect 1 0 2 0;
#P connect 0 0 1 0;
#P window clipboard copycount 4;

~nks



MIB
October 17, 2007 | 6:21 pm

Hey there,

I am sure there is an easier way than what I have, but it works… you will need the loudness~ object (check maxobjects.com).
Hope this helps…

#P window setfont "Sans Serif" 9.;
#P flonum 266 277 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 266 255 34 196617 + 96.;
#P flonum 266 237 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 18.;
#N vpatcher 47 74 331 430;
#P window setfont "Sans Serif" 9.;
#P newex 50 193 33 196617 mean;
#B color 5;
#P newex 50 172 176 196617 pack 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.;
#P newex 63 151 161 196617 bucket 11;
#P message 132 71 21 196617 log;
#P message 153 71 34 196617 1000;
#P number 153 89 35 9 0 8188 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 187 72 51 196617 Hop size;
#P newex 153 50 45 196617 loadbang;
#P newex 50 122 101 196617 loudness~ 1024 512;
#B color 6;
#P inlet 50 30 15 0;
#P outlet 50 303 15 0;
#P connect 1 0 2 0;
#P fasten 7 0 2 0 137 119 55 119;
#P fasten 5 0 2 0 158 114 55 114;
#P connect 2 0 9 0;
#P connect 9 0 10 0;
#P connect 10 0 0 0;
#P fasten 2 0 8 0 55 146 68 146;
#P connect 8 0 9 1;
#P connect 8 1 9 2;
#P connect 8 2 9 3;
#P connect 8 3 9 4;
#P connect 8 4 9 5;
#P connect 3 0 7 0;
#P connect 8 5 9 6;
#P connect 3 0 6 0;
#P connect 6 0 5 0;
#P connect 8 6 9 7;
#P connect 8 7 9 8;
#P connect 8 8 9 9;
#P connect 8 9 9 10;
#P connect 8 10 9 11;
#P pop;
#P newobj 343 139 120 196626 p loudness~;
#P user multiSlider 343 202 125 101 -96. 30. 1 3193 47 0 0 2 0 0 1;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P user multiSlider 343 183 125 15 -96. 30. 1 2680 47 0 0 2 0 0 1;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P user ezdac~ 112 56 156 89 0;
#P user gain~ 266 298 24 100 126 0 1.071519 7.94321 200.;
#P window setfont "Sans Serif" 9.;
#P newex 343 114 31 196617 adc~;
#P connect 7 0 8 0;
#P connect 7 0 1 0;
#P connect 3 0 6 0;
#P connect 3 0 4 0;
#P connect 6 0 7 0;
#P connect 5 0 3 0;
#P connect 0 0 5 0;
#P window clipboard copycount 9;


October 17, 2007 | 7:21 pm

Hi, you could also try this quick n dirty approach. It probably needs some tuning:

max v2;
#N vpatcher 455 112 1348 597;
#P user multiSlider 191 334 196 92 0. 157. 1 3177 15 0 0 2 0 0 0;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 84 231 97 9109513 scale 0. 1. 0. 127. 10;
#P flonum 83 261 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P user gain~ 83 286 24 100 158 0 1.071519 7.94321 10.;
#P flonum 93 203 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P user meter~ 93 80 116 171 10 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 93 36 31 9109513 adc~;
#P connect 5 0 4 0;
#P connect 4 0 3 0;
#P connect 2 0 5 0;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P connect 3 1 6 0;

cheers

Gerald


October 17, 2007 | 8:20 pm

> Basically, I want to recieve audio and translate the signal so that it moves a slider. I’ve tried to solve it one of two ways:

This didn’t work?

#P user ezdac~ 167 120 211 153 0;
#P user gain~ 107 258 24 100 158 0 1.071519 7.94321 10.;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 107 209 41 196617 * 127.;
#P user meter~ 107 94 130 185 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 107 50 31 196617 adc~;
#P connect 2 0 3 0;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P window clipboard copycount 5;


October 17, 2007 | 9:28 pm


October 17, 2007 | 10:53 pm

Thanks all.

Mike Z, yes that works. I didn’t do the *126 I only did *1.

Thanks for the missing link :-P

How would I add like a decay or delay?

Like this:

while x<126 && x>0 {
X–;
}

~nks


October 17, 2007 | 11:02 pm

Nevermind guys. I always type these things completely forgetting about the tutorials and "Get Info" stuff.

In the words of Asia, "It was the heat of the moment."

~nks


October 18, 2007 | 12:58 am

On 18 oct. 07, at 07:53, nk_snyder wrote:

> How would I add like a decay or delay?
>
> Like this:
>
> while x<126 && x>0 {
> X–;
> }

You may have a try with [slide] to smooth your values.

ej


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