MIDI toggle
Guys,
sorry for the silly question but it's not working as I supposed.
This is a simple code I use in Pure Data to use a MIDI button as ON/OFF.
Can you help me?

This is what I use in PD

Hello Boris.
Sorry for my silly question too : what do you call a "MIDI button as ON/OFF" ?
At 1st view, when you connect several patch cord to a same outlet you cannot know the order of triggering.. So the 2 patchs going to the 2 gate's inlets in the same time seem strange to me..What do you want to achieve ?
11 objects to convert 1 to 0/1 ?
what about...
[notein]
[counter 0 0 1]
Schlam, I use it for example to [bang] a [metro] with a midi controller
Sorry Roman, I am a newbie… but I think it's missing something, cause [counter] counts, it is not selecting.
Anyway I found this solution, but maybe is it possible to use less objects?

Hello Friends
Nothing wrong with being newbie or with following personal way of thinking by using more objects than pure logic needs - Max is very good for this kind of "free sketching". And we can always clear and optimise patch later if we want to.
I'm not sure if I understood the goal correctly, but here are 4 drafts you may be interested to check:
Thanks Yaniki, it's excellent!
https://cycling74.com/forums/-live-text-to-trig-note-on-note-off