Page 1 of 1
Posted: 22 Sep 2010, 09:28
by gurulogic
I have many good uses for an events control module similar to the way the smooth module timer works that would take the last input value and hold it for a set amount of time , then when the value 'hold' has timed out the module would send a user definable 'reset value'.
One more option for the module could be to reset the timer every time a new value was received or else play the entire 'last value', ignoring any new input values untill timed out.
I'm sure this is patchable but I think this function in a single module would be very usefull.
Posted: 22 Sep 2010, 09:39
by nay-seven
maybe a script or a user module...? ( do you hear the call , gurus..?

) )
Posted: 22 Sep 2010, 10:07
by ethnix73
hehe!
This would be really useful gurulogic, agree with you...for myself, It's the main difficulty with monome and launchpad.
Posted: 22 Sep 2010, 10:59
by bsork
Something like this?
Code: Select all
VAR pInValue, pOutValue, pResetValue, pHoldTime, pIgnoreWhileHold : tParameter;
VAR lastTime : Single;
VAR holding : Boolean;
PROCEDURE Init;
BEGIN
pInValue := CreateParam('value in', ptDataField); SetIsOutput(pInValue, FALSE);
pOutValue := CreateParam('value out', ptDataField); SetIsInput(pOutValue, FALSE);
pResetValue := CreateParam('reset value', ptDataField); SetIsOutput(pResetValue, FALSE);
pHoldTime := CreateParam('hold time', ptDataFader); SetIsOutput(pHoldTime, FALSE);
SetSymbol(pHoldTime, 'ms');
SetMin(pHoldTime, 0); SetMax(pHoldTime, 10000);
pIgnoreWhileHold := CreateParam('ignore new', ptSwitch); SetIsOutput(pIgnoreWhileHold, FALSE);
holding := FALSE;
END; // Init
PROCEDURE Callback(n : Integer);
BEGIN
IF (n = pInvalue) THEN BEGIN
IF ((GetValue(pIgnoreWhileHold) = 0) OR (NOT holding)) THEN BEGIN
SetValue(pOutValue, GetValue(pInValue));
lastTime := TimeMs;
holding := TRUE;
END;
END;
END; // Callback
PROCEDURE Process;
BEGIN
IF ((holding) AND ((TimeMs - lastTime) >= GetValue(pHoldTime))) THEN BEGIN
SetValue(pOutValue, GetValue(pResetValue));
holding := FALSE;
END;
END; // Process
Posted: 22 Sep 2010, 11:24
by gurulogic
Ask and ye shall receive! Seems to work fine, thanks!
Not to look a gift horse in the mouth but would a version that worked with midi be too hard to adapt from this? I presume the reset value would be a midi note off for the current note out, or alternativly a 'stop' outlet that could trigger a create midi module.
Either way, this is going in my 'very usefull' folder ~:>)
Posted: 22 Sep 2010, 11:36
by bsork
Shouldn't be too hard to implement for MIDI, but IIRC there's already something similar (at least for note messages) in the MIDI Utility pack. Check it out, I don't have time now.
Posted: 22 Sep 2010, 11:44
by gurulogic
Cool, will check...
I think the above script should definately be bundled with the next usine update. So very usefull!!!
Posted: 22 Sep 2010, 12:48
by nay-seven
great ! thanks sir bsork !
I've yet found utility to this one too !
Posted: 22 Sep 2010, 12:56
by 23fx23
sorry im not at all questionning the utility of this, im sur there are plenty.
but just by curiosity, any exemple application?
Posted: 22 Sep 2010, 13:25
by bsork
I'm also a bit curious as to what you're using it for...
Enlighten us!
Posted: 22 Sep 2010, 15:54
by nay-seven
i know i can do the same with pass and others but it's the first idea i've had :
a slow random generator for drone or pads..

Posted: 22 Sep 2010, 16:45
by noise2sine
I 've heard : slow random generator for drones ?!!? i want to test it !!!!!!!!!!
Posted: 22 Sep 2010, 16:53
by 23fx23
mm oh yeah i see the idea thanks nay, the fact to ' ignore new ' provide kind of quantized/reduce/stepped data out of the box,
othewise yes a pass with clock would do about the same, btw more handy on on only one module.
curious about guru and ethnix uses also...i guess they were after the reset value too, but what for??
Posted: 22 Sep 2010, 23:35
by gurulogic
Hmmm... my mind goes blank when looking for examples

Lets see.... how about modulating individual step durations or creating random evolving value mutations...?
Generally I see being able to hold values open in a 'gate' fashion as a utilty kind of thing.
One example that I have put into immediate use is that when I send Usine a SAVE_PATCH command, I need to ensure the patch is saved with a audio bus names that aren't in use when the patch loads, so when I press save, the bus names change to 'x', the patch saves and then after the set duration the bus names are set back to normal. If I like I could use the reset value to trigger the next patch to save using the same conditions... Probably coulda patched this some other way but this was nice n' easy.
Posted: 23 Sep 2010, 00:13
by 23fx23
yeah that make sense thanks. indeed that avoid the use of several counters, pass, affect or freez event things, having two values and timer directly, ill have to remember that

Posted: 23 Sep 2010, 21:07
by ethnix73
After testing you script bsork, it was [not] totally what i had in mind.
Maybe i'had read the first guru message too fast :rolleyes:
Anyway, may be usefull, thanks!
Posted: 23 Sep 2010, 21:24
by senso
great job bsork!!!
for info the 'math/variable' and 'math/multipleVariable' are kind of 'hold event' but without time management.
Posted: 23 Sep 2010, 22:08
by bsork
Yes - I don't htink it would be hard to patch the same thing.
Posted: 23 Sep 2010, 22:31
by senso
a script version will always be more efficient in CPU.
the main drawback of scrips is that it generally take more memory than it should.
That's why I prepare the concept of 'compiled script'. It will be a script but without any possible modification. Much more light...
Posted: 23 Sep 2010, 23:08
by 23fx23
wow that sound cool that!!
Posted: 24 Sep 2010, 00:02
by bsork
More efficient?!? Wow - things have changed more than I thought!
Posted: 24 Sep 2010, 14:12
by multiphone
After scratching my head a few minutes wondering what Guru was doing with this script... and afer Nay patch inspiration...I found an application to move the sounds in space.
The movement are quite interesting and unexpected.
Not to bad
Best...
Posted: 24 Sep 2010, 16:59
by senso
bsork wrote:More efficient?!? Wow - things have changed more than I thought!
Yes especially if most of the code is in the Callback procedure.
Actually there is a bottle neck, in multicore CPU: only one script can be executed at the same time. but will disappear in the 5.30
Posted: 24 Sep 2010, 17:52
by multiphone
First words is :
"Ho ! My God ! "
This 5.3 are dream !
Best
Posted: 24 Sep 2010, 18:01
by 23fx23
wow wow 5.3 seems raising even higher levels..can't wait..