Page 1 of 1

Step up down by MIDI input

Posted: Wed Mar 31, 2021 5:19 pm
by stefan
Hello Magic Community

I'm currently started with this amazing program. But now i need your help mow. I tried to find the answer in the forum, but maybe i used the wrong word to search.

I have an external controller connected via midi. On this controller i have two button which are acting as a "+" and a "-" Button.

I want now for example translate the width (X Value) of a polygone with this button in 0.1 steps. + makes it wider and - makes is narrower (Means changing the size with a + and - input signal).

Is that possible? Can anybody give me a hint how to do this?

Thanks

Re: Step up down by MIDI input

Posted: Wed Mar 31, 2021 9:17 pm
by Sadler
Try a scaled trigger modifier that is triggered by midi source.

Re: Step up down by MIDI input

Posted: Wed Mar 31, 2021 11:09 pm
by Magic
Yes, the modifier called “integer trigger” or “trigger (int)” is what you’re looking for.

You may need to have two separate Globals, one for the + button and one for the - button, then make the - button negative, and then sum it with the + button in an Expression.

Re: Step up down by MIDI input

Posted: Thu Apr 01, 2021 3:35 pm
by stefan
Hey Guy's

I got it running, thanks for the help so far.

I can now count up and down, but the last remaining problem is that if i count to much down i need to count up first until i reach 0 (means like in the attach screenshot 61-63. to get 0 i need to count up by 2 first). Any idea how i can solve this one?

I added a screenshot of what i did.

Is that right that a trigger can not trigger negative (so means it only goes up)?

Have a nice day!

Re: Step up down by MIDI input

Posted: Thu Apr 01, 2021 7:40 pm
by Sadler
if you remove the gate it will work as expected though you would have to deal with negatives. If you use an abs on the expression each button will continue to count but stay positive.

Re: Step up down by MIDI input

Posted: Fri Apr 02, 2021 11:43 am
by stefan
Found a solution!

I just made an "if" and checked if downCount is smaller than upCount. So downCount never can be higher than upCount.

Works perfect.

Thanks for your help. Much appriciated.

Stefan

Re: Step up down by MIDI input

Posted: Fri Apr 02, 2021 3:03 pm
by Magic
Excellent. Yes, that’s the solution, nice work.

Just FYI, you don’t have to have a separate Global for upCount and downCount. You can put the Trigger directly in buttonDown and buttonUp. Would simplify your project a tiny bit.