ArrayArrayArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2015-02-04T14:25:19+02:00 https://brainmodular.com/forums/app.php/feed/topic/4679 2015-02-04T14:25:19+02:00 2015-02-04T14:25:19+02:00 https://brainmodular.com/forums/viewtopic.php?t=4679&p=31194#p31194 <![CDATA[script timing mechanism]]> Just a simple clock from the library with the trigger wired allows the time to either be controlled via interval or actually sync'd to a tempo.

The advantage of using this is the immediate callback and then you can just write your own function/procedure. With this you can increment/decrement a variable to use in your script for counting/timing. If you are using multiple scripts you can just wire the single clock to your scripts to base off the same.

I agree about the ease of an api timer, but with the ability to get Date/Time and have immediate callback tick processing I don't think its necessary. I am not an expert with Pascal, but I don't think there ever was a built in timer...but just based off Date/Time??
I would think for HH though using the module for clocking is much more efficient than actually processing Date/Time continuously within the fastscript.

-S

Statistics: Posted by sephult — 04 Feb 2015, 13:25


]]>
2015-02-04T12:04:03+02:00 2015-02-04T12:04:03+02:00 https://brainmodular.com/forums/viewtopic.php?t=4679&p=31191#p31191 <![CDATA[script timing mechanism]]>
The process procedure is repeatedly processed...go figure. So if you have heavy load in the process loop that doesn't need to be done make sure to avoid calling it . For instance if you have array processing, make sure you are only doing it by trigger, or you will soon see your CPU climb.

I had an array once I forgot to block and quickly overloaded my CPU.

-S
Well that is the disadvantage of bloc counting in the process procedure. You can use the processIDLE procedure if the interval is not too large (default 25ms I think) but since it various with the UI refresh setting you'd have to make sure it was OK on the slowest UI updates.
I am using bloc counting in the process procedure to produce ticks at a slower rate, and the ticks are switched off when not required, in which case the only code in the process procedure is a comparison operation to see if ticks are required.

The alternative as I found is to connect up a module such as countms with appropriate parameter inputs and outputs, which seems rather clumsy from a script. What is really required is a timer API available to the script.

Statistics: Posted by sm_jamieson — 04 Feb 2015, 11:04


]]>
2015-02-03T02:58:14+02:00 2015-02-03T02:58:14+02:00 https://brainmodular.com/forums/viewtopic.php?t=4679&p=31185#p31185 <![CDATA[script timing mechanism]]>
I had an array once I forgot to block and quickly overloaded my CPU.

-S

Statistics: Posted by sephult — 03 Feb 2015, 01:58


]]>
2015-02-03T01:00:54+02:00 2015-02-03T01:00:54+02:00 https://brainmodular.com/forums/viewtopic.php?t=4679&p=31183#p31183 <![CDATA[script timing mechanism]]> I had used the countms module, but it seemed so clumsy to rig up input and output parameters and "wires" just to get the timeout functionality. The script API could really do with a proper timeout facility, but bloc counting will do !

Simon.

Statistics: Posted by sm_jamieson — 03 Feb 2015, 00:00


]]>
2015-02-02T20:19:21+02:00 2015-02-02T20:19:21+02:00 https://brainmodular.com/forums/viewtopic.php?t=4679&p=31182#p31182 <![CDATA[script timing mechanism]]>
Here is the list of script functions:
http://www.sensomusic.org/wiki2/doku.ph ... _reference

There is a date time that could probably be used as well, however if you want sync rather than a timer I would use a clock trigger on callback; then you can just enter your functions/procedures from there.

-S

Statistics: Posted by sephult — 02 Feb 2015, 19:19


]]>
2015-02-02T19:46:17+02:00 2015-02-02T19:46:17+02:00 https://brainmodular.com/forums/viewtopic.php?t=4679&p=31181#p31181 <![CDATA[script timing mechanism]]> count:= count+1 , if count >=X then... or fadervalue:= count/divisor

but maybe a function is avaible for directly get current time in ms but i don't know...
if so on reset sould substact resettime to currenttime to get a ms counter.

Statistics: Posted by 23fx23 — 02 Feb 2015, 18:46


]]>
2015-02-02T18:58:42+02:00 2015-02-02T18:58:42+02:00 https://brainmodular.com/forums/viewtopic.php?t=4679&p=31180#p31180 <![CDATA[script timing mechanism]]>

but i'll probably use some of the time modules
http://www.sensomusic.org/wiki2/doku.ph ... es:time_ms
http://www.sensomusic.org/wiki2/doku.ph ... se_time_ms

Statistics: Posted by drakh — 02 Feb 2015, 17:58


]]>
2015-02-02T16:41:53+02:00 2015-02-02T16:41:53+02:00 https://brainmodular.com/forums/viewtopic.php?t=4679&p=31179#p31179 <![CDATA[script timing mechanism]]> Is there a way to generate timer messages in the scripting language, i.e. set a timer going that sends a callback every 50 millsecs until it is cancelled ?
I wish to use this to generate a midi channel volume fade within my script.

Thanks,
Simon.

Statistics: Posted by sm_jamieson — 02 Feb 2015, 15:41


]]>
BrainModular BrainModular Users Forum 2015-02-04T14:25:19+02:00 https://brainmodular.com/forums/app.php/feed/topic/4679 2015-02-04T14:25:19+02:00 2015-02-04T14:25:19+02:00 https://brainmodular.com/forums/viewtopic.php?t=4679&p=31194#p31194 <![CDATA[script timing mechanism]]> Just a simple clock from the library with the trigger wired allows the time to either be controlled via interval or actually sync'd to a tempo.

The advantage of using this is the immediate callback and then you can just write your own function/procedure. With this you can increment/decrement a variable to use in your script for counting/timing. If you are using multiple scripts you can just wire the single clock to your scripts to base off the same.

I agree about the ease of an api timer, but with the ability to get Date/Time and have immediate callback tick processing I don't think its necessary. I am not an expert with Pascal, but I don't think there ever was a built in timer...but just based off Date/Time??
I would think for HH though using the module for clocking is much more efficient than actually processing Date/Time continuously within the fastscript.

-S

Statistics: Posted by sephult — 04 Feb 2015, 13:25


]]>
2015-02-04T12:04:03+02:00 2015-02-04T12:04:03+02:00 https://brainmodular.com/forums/viewtopic.php?t=4679&p=31191#p31191 <![CDATA[script timing mechanism]]>
The process procedure is repeatedly processed...go figure. So if you have heavy load in the process loop that doesn't need to be done make sure to avoid calling it . For instance if you have array processing, make sure you are only doing it by trigger, or you will soon see your CPU climb.

I had an array once I forgot to block and quickly overloaded my CPU.

-S
Well that is the disadvantage of bloc counting in the process procedure. You can use the processIDLE procedure if the interval is not too large (default 25ms I think) but since it various with the UI refresh setting you'd have to make sure it was OK on the slowest UI updates.
I am using bloc counting in the process procedure to produce ticks at a slower rate, and the ticks are switched off when not required, in which case the only code in the process procedure is a comparison operation to see if ticks are required.

The alternative as I found is to connect up a module such as countms with appropriate parameter inputs and outputs, which seems rather clumsy from a script. What is really required is a timer API available to the script.

Statistics: Posted by sm_jamieson — 04 Feb 2015, 11:04


]]>
2015-02-03T02:58:14+02:00 2015-02-03T02:58:14+02:00 https://brainmodular.com/forums/viewtopic.php?t=4679&p=31185#p31185 <![CDATA[script timing mechanism]]>
I had an array once I forgot to block and quickly overloaded my CPU.

-S

Statistics: Posted by sephult — 03 Feb 2015, 01:58


]]>
2015-02-03T01:00:54+02:00 2015-02-03T01:00:54+02:00 https://brainmodular.com/forums/viewtopic.php?t=4679&p=31183#p31183 <![CDATA[script timing mechanism]]> I had used the countms module, but it seemed so clumsy to rig up input and output parameters and "wires" just to get the timeout functionality. The script API could really do with a proper timeout facility, but bloc counting will do !

Simon.

Statistics: Posted by sm_jamieson — 03 Feb 2015, 00:00


]]>
2015-02-02T20:19:21+02:00 2015-02-02T20:19:21+02:00 https://brainmodular.com/forums/viewtopic.php?t=4679&p=31182#p31182 <![CDATA[script timing mechanism]]>
Here is the list of script functions:
http://www.sensomusic.org/wiki2/doku.ph ... _reference

There is a date time that could probably be used as well, however if you want sync rather than a timer I would use a clock trigger on callback; then you can just enter your functions/procedures from there.

-S

Statistics: Posted by sephult — 02 Feb 2015, 19:19


]]>
2015-02-02T19:46:17+02:00 2015-02-02T19:46:17+02:00 https://brainmodular.com/forums/viewtopic.php?t=4679&p=31181#p31181 <![CDATA[script timing mechanism]]> count:= count+1 , if count >=X then... or fadervalue:= count/divisor

but maybe a function is avaible for directly get current time in ms but i don't know...
if so on reset sould substact resettime to currenttime to get a ms counter.

Statistics: Posted by 23fx23 — 02 Feb 2015, 18:46


]]>
2015-02-02T18:58:42+02:00 2015-02-02T18:58:42+02:00 https://brainmodular.com/forums/viewtopic.php?t=4679&p=31180#p31180 <![CDATA[script timing mechanism]]>

but i'll probably use some of the time modules
http://www.sensomusic.org/wiki2/doku.ph ... es:time_ms
http://www.sensomusic.org/wiki2/doku.ph ... se_time_ms

Statistics: Posted by drakh — 02 Feb 2015, 17:58


]]>
2015-02-02T16:41:53+02:00 2015-02-02T16:41:53+02:00 https://brainmodular.com/forums/viewtopic.php?t=4679&p=31179#p31179 <![CDATA[script timing mechanism]]> Is there a way to generate timer messages in the scripting language, i.e. set a timer going that sends a callback every 50 millsecs until it is cancelled ?
I wish to use this to generate a midi channel volume fade within my script.

Thanks,
Simon.

Statistics: Posted by sm_jamieson — 02 Feb 2015, 15:41


]]>