reset to default
-
- Newbie
- Posts: 37
- Joined: 09 Jun 2012 16:51
reset to default
hello can someone tell me how to make a button (custom or switch) with "double tap" to reset the value to default (ex pan to center or fader to 0db) ?
thanks
thanks
Re: reset to default
the double-tap feature is a bit more complicated, but the reset feature should work with a Pads object and a script, executable On Expression x, and the line Knob.x=0.5, assuming the pan knob is bipolar. For the fader Fader.x=? where ? is the value that corresponds 0 dB. You can use a Monitor with Fader.x in the value field object to get that value.
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro
Re: reset to default
To handle double taps with a pad, the pad has to keep track of how much time has elapsed since the last press. If that time hasn't been too long, it sets the value of the fader to 0 or 0.5, depending on polarity.
For the button (a pad), add a variable called last_pressed. Set it to 0 by default. Add this script to be executed On Expression x:
If the elapsed time is less than 0.25 seconds, it will set the fader to zero. If you have a bipolar fader, set it to 0.5.
Example attached.
For the button (a pad), add a variable called last_pressed. Set it to 0 by default. Add this script to be executed On Expression x:
Code: Select all
if(x == 0) return; //don't trigger when the pad is released.
if ((time - last_pressed) < 0.25)
Fader.x = 0;
last_pressed = time;
Example attached.
- Attachments
-
- doubleclick.jzml
- double click example
- (3.6 KiB) Downloaded 203 times
Last edited by brianc on 16 Jun 2012 15:08, edited 1 time in total.
-
- Newbie
- Posts: 37
- Joined: 09 Jun 2012 16:51
Re: reset to default
thanks I will try
Re: reset to default
Phil999 : could you please clarify how to do this step by step ? I'm quite new to this script thing and can't figure it out just following the manual. What I want to do is having a pad that resets my fader at 0db.
Re: reset to default
I'm also quite new to scripting.
Did you try the excellent example from brianc? The script should be inside the Pads object that functions as reset button. It tells the Fader object to go to a certain value. Now, to know what value you can use a Monitor object like described above.
I think it should be clear now, but feel free to ask if it isn't. I'm glad being able to help despite my very limited knowledge.
Did you try the excellent example from brianc? The script should be inside the Pads object that functions as reset button. It tells the Fader object to go to a certain value. Now, to know what value you can use a Monitor object like described above.
I think it should be clear now, but feel free to ask if it isn't. I'm glad being able to help despite my very limited knowledge.
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro
Re: reset to default
I tried to do this very simple thing but can't get it to work. The monitor thing works but not the pad reset.Phil999 wrote: but the reset feature should work with a Pads object and a script, executable On Expression x, and the line Knob.x=0.5, assuming the pan knob is bipolar. For the fader Fader.x=? where ? is the value that corresponds 0 dB. You can use a Monitor with Fader.x in the value field object to get that value.
There must be something obvious (if that exists in the programming world for someone without a clue) I'm missing. Could you please do this and post it as a module so I can see where my mistake is ? Drives me crazy to be able to patch in Max and not being able to do this
-
- Liine Staff
- Posts: 285
- Joined: 01 Oct 2010 11:06
Re: reset to default
example attached, is this what you meant?Stephmo wrote:I tried to do this very simple thing but can't get it to work. The monitor thing works but not the pad reset.Phil999 wrote: but the reset feature should work with a Pads object and a script, executable On Expression x, and the line Knob.x=0.5, assuming the pan knob is bipolar. For the fader Fader.x=? where ? is the value that corresponds 0 dB. You can use a Monitor with Fader.x in the value field object to get that value.
There must be something obvious (if that exists in the programming world for someone without a clue) I'm missing. Could you please do this and post it as a module so I can see where my mistake is ? Drives me crazy to be able to patch in Max and not being able to do this
have a look at the user guide and scripting examples in the user library...
Re: reset to default
Thanks a lot Nick. I have read the user guide and watched the tutorials but had underestimated the power of the almighty semicolon... Devil in the detail.
I think I assumed single line scripts didn't need it.
I think I assumed single line scripts didn't need it.