simple buttom question

Discuss Lemur and share techniques.
digitalson
Regular
Posts:143
Joined:21 Mar 2015 02:26
simple buttom question

Post by digitalson » 26 Apr 2015 06:02

what was the way to make a button preform 2 functions when holding it down longer,? i want to press it for fast forward and hold it for the fast fast forward,,,any suggestions?

Softcore
Regular
Posts:1639
Joined:04 Nov 2012 08:34

Re: simple buttom question

Post by Softcore » 26 Apr 2015 19:24

One way to do this is to use an onframe script that "checks" if "x" of the button is on for a period of time....

And then make it so, that if that period of time has passed, an added expression (say, k) will go to 1, and when the button is off k goes to 0. Then map "k" expression to your desired function.

digitalson
Regular
Posts:143
Joined:21 Mar 2015 02:26

Re: simple buttom question

Post by digitalson » 27 Apr 2015 14:43

can u give me an example,im kinda new to lemur,i spent the last 3 months making a complete nuendo cubase templete ,and it is killer ,but need more multifunction stuff,,,thanks

ndivuyo
Regular
Posts:279
Joined:23 May 2014 00:24

Re: simple buttom question

Post by ndivuyo » 27 Apr 2015 23:25

I used to do it how softcore mentioned, until he pointed out the multislider physics apply even when you change the value from a script. That's what I've been using for my short timers and animations lately, and it works awesome (and is inexpensive I think?)

I gotta run, but:
--- for an on frame script
-make a script execute on frame
-make an array or a couple variables. 1 value will be a trigger and the other will be a timer
-have a script when you press the button and have that turn the trigger array value to '1' or whatever
-in the on frame script have it check when that trigger value ==1 then have the timer value increment (++)
-then if/when the timer reaches your desired value, you trigger the other action and reset the timer and trigger values.

But with a multislider, you can create a trigger/timer system and the timer will just be the time it takes for the multislider to reach '0' or wherever the gravity is pulling to.


ok gotta go!!!

Softcore
Regular
Posts:1639
Joined:04 Nov 2012 08:34

Re: simple buttom question

Post by Softcore » 28 Apr 2015 21:17

ndivuyo wrote:I used to do it how softcore mentioned, until he pointed out the multislider physics apply even when you change the value from a script. That's what I've been using for my short timers and animations lately, and it works awesome (and is inexpensive I think?)
Indeed thats what I thought too, exactly why I was happy to discover this

@ digitalson: One question though, is it going to be a Pad object or a switch object?

digitalson
Regular
Posts:143
Joined:21 Mar 2015 02:26

Re: simple buttom question

Post by digitalson » 29 Apr 2015 15:12

a pad,,,i want to use ff and rewind and hold longer to use fast rewind and forward ,i saw some one do it ,can someone give me a example for the snytax for the script,,,,thanks i am new to lemur

Softcore
Regular
Posts:1639
Joined:04 Nov 2012 08:34

Re: simple buttom question

Post by Softcore » 29 Apr 2015 19:43

Here you go....Map the Pad's expression "p" to anything you want to be mapped to the "long Press".

Inside the Pad object you can change the "delay" time (the time that is considered to be the threshold for a long press) to your liking,

Feel free to delete the monitor objects - they are there just to show you that it works.
Attachments
Pad-withDelayedOutputP.jzml
(4.98KiB)Downloaded 94 times

digitalson
Regular
Posts:143
Joined:21 Mar 2015 02:26

Re: simple buttom question

Post by digitalson » 01 May 2015 07:00

thanks sooo much,,,its gonna clear up lots of buttons,,,,and if u or anyone are using cubase ,my lemur project is killer,took me 3 months to do,and had to change lots from nuendo 6.5 to cb pro 8,i will send it when done,it prob has 400kc's

digitalson
Regular
Posts:143
Joined:21 Mar 2015 02:26

Re: simple buttom question

Post by digitalson » 02 May 2015 04:54

hey i tried the delay thing,and its not really working correct maybe cause its a pad not a button,when pressed and held it still does the 1st command,so heres an idea,,,,can i use a switch to change the action of a button,? cause i can wrap 2 or 4 switches around a button, how can that be done, a switch that changes the output of a button?

digitalson
Regular
Posts:143
Joined:21 Mar 2015 02:26

Re: simple buttom question

Post by digitalson » 02 May 2015 04:55

this way i can clean up lots of buttons that do simalair things

Post Reply