## how to recept the cahnge of midi slider?

Nov 7, 2009 at 10:54pm

# how to recept the cahnge of midi slider?

dear users,

Sorry for this very stupid question:
If I want to know how much value is changed when I move midi slider, what should I do?

– Pasted Max Patch, click to expand. –

best,
prko

#46347
Nov 7, 2009 at 10:57pm

what I want to do is the following:
If the value is changed more than 30 (also -30), I want to produce a bang.

#166885
Nov 7, 2009 at 11:41pm

You could use [mousefilter] as demonstrated in the patch below or write your own [metro] based patch if you have a particular polling time in mind.

lh

– Pasted Max Patch, click to expand. –

#166886
Nov 7, 2009 at 11:42pm

Like this maybe?

– Pasted Max Patch, click to expand. –
#166887
Nov 7, 2009 at 11:46pm

Mousefilter won’t make any difference when using MIDI input, just something to keep in mind when designing a patch.

#166888
Nov 7, 2009 at 11:59pm

Thank you very much!
The two examples are very good and useful examples.

They are slightly different from my question.
What I need is not a absolute value 30, but the difference of two values.
If I move very slowly a midi slider from 0 to 127, we have the following changes:

0 – 1
1 – 2
2 – 3
3 – 4
….
125 – 126
126 – 127

However, if we move it more quickly, then max can recognise as follows:

0 – 5
5 – 15
15 – 24
….
100 – 110
110 – 115

IF we more quickly move the slider, then:

0 – 30
30 – 70
70 – 110
110 – 127

What I mean is this change od value.
The difficulty is the following:
we have to define only two variables (a and b)
Firstly a = 0
Secondly b = 2
Then thirdly, a should be 2.
then fourthly, b should be 3.
and so on….

this routine!
how can we program this routine?

best,
prko

#166889
Nov 8, 2009 at 12:22am

I found the solution!

– Pasted Max Patch, click to expand. –

#166890
Nov 8, 2009 at 12:26am

even better is as follows:

– Pasted Max Patch, click to expand. –

#166891
Nov 8, 2009 at 1:01am

you already noticed that the mousepolling time comes across the
idea to recognize a certain value, but i would offer this to
find the value:

[t f f]

[pipe 80.] (to \$f2)

[if ((abs(\$f1-\$f2))>=30.) then bang]

#166892
Nov 8, 2009 at 1:05am

you already noticed that the mousepolling time comes across the
idea to recognize a certain value, but i would offer this to
find the value:

[t f f]

[pipe 80.] (to \$f2)

[if ((abs(\$f1-\$f2))>=30.) then bang]

ah, and for filling the gaps, if you really want to do this,
[line] should do it just fine, of course all with a little delay.

whenever input changes´, let [line 0 2] draw from last value to
current value and put a [change] behind it.

-110

.

#166893
Nov 8, 2009 at 1:06am

I think your method is stable, for you define an execution time.

best,
prko

#166894
Nov 8, 2009 at 1:09am

depending on what you do, consider doing it all as signal, might
be easier.

#166895
Nov 8, 2009 at 4:15pm

dear users,

is there any object or command to move and resize the MAX window?
I mean the MAX post window.

best,
prko

#166896

You must be logged in to reply to this topic.