split midi range

gantzgraf's icon

Hello,
i´m new here and my very first question is how could i split the midi range 0 - 127 in for example 0 - do nothing, 1 to 20 (Message 1), 21 to 40 (Message 2), 41 to 60 (Message 3) and so on......
I tried out different nodes and checked out the tutorials...but i didn´t come forward....pleas help.
thx

Andro's icon

use the exp object or vexpr object.

gantzgraf's icon

Thanks for your reply. But i didn´t figured out how to use the exp/vexp objects. But i got an i idea how to fix my problem. Maybe it´s not the convenient way how i used to do it. See the example in the attachement. Thx.

split_midi.maxpat
Max Patch
vichug's icon
Max Patch
Copy patch and select New From Clipboard in Max.
gantzgraf's icon

Thanks, Vichug. I´m on Win with Max 6. Are these externals available for Max6/Win7? I guess just for Mac or Max 5 on Win. Nevertheless thx.

Roman Thilenius's icon

[expr (($i1>0)*($i1>=20))*1 + (($i1>20)*($i1>=40))*2 + ($i1>40)*($i1>=60))*3]
|
[select 1 2 3]

or

[expr ($i1>0)*(($i1/20)+1)]
|
[select 1 2 3 4 5 6 7]

-110

Roman Thilenius's icon

or

[* 0.05]
[+ 1]
[coll]

gantzgraf's icon

thank you, sorry for beeing late with my reply. This works fine, but is there an option that if a number occurs in these ranges just one bang is outputted and the other numbers in this range are getting ignored? I´m sorry for bother you again. I has had a look at the onebang objekt, but it doesn´s seems to work in this way.