Forums > MaxMSP

how to recept the cahnge of midi slider?

November 7, 2009 | 10:54 pm

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


November 7, 2009 | 10:57 pm

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


November 7, 2009 | 11:41 pm

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. –

November 7, 2009 | 11:42 pm

Like this maybe?

– Pasted Max Patch, click to expand. –

November 7, 2009 | 11:46 pm

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


November 7, 2009 | 11:59 pm

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


November 8, 2009 | 12:22 am

I found the solution!

– Pasted Max Patch, click to expand. –

November 8, 2009 | 12:26 am

even better is as follows:

– Pasted Max Patch, click to expand. –

November 8, 2009 | 1:01 am

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]


November 8, 2009 | 1:05 am

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

.


November 8, 2009 | 1:06 am

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

best,
prko


November 8, 2009 | 1:09 am

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


November 8, 2009 | 4:15 pm

dear users,

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

best,
prko


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