Previous topicNext topic

Step up down by MIDI input

Questions, comments, feedback, etc.
Post Reply
stefan
Posts: 4
Joined: Wed Mar 31, 2021 5:09 pm

Step up down by MIDI input

Post 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
Sadler
Posts: 1200
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

Re: Step up down by MIDI input

Post by Sadler »

Try a scaled trigger modifier that is triggered by midi source.
Magic
Site Admin
Posts: 3451
Joined: Wed Apr 09, 2014 9:28 pm

Re: Step up down by MIDI input

Post 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.
stefan
Posts: 4
Joined: Wed Mar 31, 2021 5:09 pm

Re: Step up down by MIDI input

Post 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!
Attachments
stepupdown.JPG
stepupdown.JPG (40.36 KiB) Viewed 4704 times
Sadler
Posts: 1200
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

Re: Step up down by MIDI input

Post 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.
stefan
Posts: 4
Joined: Wed Mar 31, 2021 5:09 pm

Re: Step up down by MIDI input

Post 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
Attachments
12.JPG
12.JPG (43.07 KiB) Viewed 4689 times
Magic
Site Admin
Posts: 3451
Joined: Wed Apr 09, 2014 9:28 pm

Re: Step up down by MIDI input

Post 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.
Post Reply