Previous topicNext topic

Raising and falling edge triggers (counters)

Questions, comments, feedback, etc.
Post Reply
PoohBear
Posts: 32
Joined: Tue Mar 13, 2018 1:02 am

Raising and falling edge triggers (counters)

Post by PoohBear »

I have searched the forum as I'm sure this has been asked before.

How can I detect a change in a value (up or down) say from CC data. I'm looking for away to convert that change into a trigger (or counter), e.g. to change Goto Next for my next video file.


I have one other little funny, as I can detect voltage change at my end I thought I would convert that to a trigger and send it to Magic via a CC, however I always have to send it twice no matter if I have a few ms or 10 seconds between sending the trigger, it is a short trigger and I know it's dropping to 0 before sending again. If it's a longer trigger it seams OK, but that fact I have to always send it twice to retrigger in Magic has got me, If it triggered even now and then I could understand that being a timing issue, but it's ever other time without fail.

I'm also a little confused with the beta new "y" variable, I thought I would have been able to use something like if(x != y,1,0) to detect a CC change in value.

Cheers
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Raising and falling edge triggers (counters)

Post by Magic »

First of all, if you're asking how to use MIDI to control a trigger button parameter (like Goto Next), then it's as simple as it can be: just link the MIDI to that parameter. If the incoming MIDI value is above .5 (meaning above 64), and the previous value was below .5, then the trigger will be activated. Search the User's Guide for "trigger button" for a bit more info.

The following topic might answer one of your other questions: https://magicmusicvisuals.com/forums/vi ... f=2&t=2315

As for the Expression question, remember that if you output 1 or 0, then that value becomes the y variable, so it makes your expression worthless. Really what you want is the previous input value, sort of an x', which isn't currently available, but I am planning on adding it in a future build. It will allow you to do expressions like abs(x-x'), which would be non-zero only when the value has changed, thus allowing you to use it as a trigger.
PoohBear
Posts: 32
Joined: Tue Mar 13, 2018 1:02 am

Re: Raising and falling edge triggers (counters)

Post by PoohBear »

Eric wrote:First of all, if you're asking how to use MIDI to control a trigger button parameter (like Goto Next), then it's as simple as it can be: just link the MIDI to that parameter. If the incoming MIDI value is above .5 (meaning above 64), and the previous value was below .5, then the trigger will be activated. Search the User's Guide for "trigger button" for a bit more info.
I get triggers but I not asking that as my input values are changing and that is what I want to detect (either way going up or down), so I want to turn going from .01 to .02 into a trigger or even a counter, but next time I might go from .02 to .39 I want the same trigger or .39 to .14 etc.

In my case the CC data I was thinking about using in a Translate which is straight forward but I would also want that same data to fire off a trigger on change..

Yes my manual triggers I was firing in are extremely short and that article does answer that.

and a DOH brain fart moment with the "y" expression!!! yes I understand what you are saying about the y expression, I was being silly and now have the answer I need for all of the above..

if(roundn(x,5) = roundn((Frac(y)*10),5),x/10,1+(x/10))

In my case I don't need to divide by 10 as I know my values are below 0.5 but it's there so it will work with future values above 0.5

Thanks for the info as it did make a bell ring in my head...
Post Reply