DADEV : Digital Audio Development :
 


 
 

SCOPE DEVELOPEMENT PLATFORM CORNER> ARTICLES

Programming articles for developers.

How to do a device time protection without having to code in DSP???

There is an easy way to create a time protection to your devices without the need of extra DSP coding, just using the atoms given with the Scope Development 1.1 (and better)

The idea is to program the following algorythm :

time=0;    initialize the time counter to 0
timeleft = 600 ; set the maximum time before the device will stop working. 600 s = 10 mn.
addsecond  = 1 ;  we will add one second per second.. increment.
start:
Wait 1 second
time=time+addsecond;
result = timeleft - time
go to start until result = 0

This program will add 1 to the seconds counter until it reach the number max of seconds (600 in this case)

Here is in practice the way to program it with the basic and limited Scope Development. The 63 value is the time variable. We pass this variable (which is = 0 at the beginning) to the in1 of an async add and we plug the addsecond variable to the in2 of this async add. This will add the 2 value (time=time+addsecond)

We pass to a Feedback module to avoid any errors and go to a 256 K PC delay line (or whatever that can wait 1s or 1000 ms). It is where we do the "Wait 1 second" instruction.

We go to a Script substracter Ex to do the result=timeleft-time and here the result is 537.

This thing will change every second and you just have to use a switch or use an "IF" to check if the value of result is <=0. If it is the case, just cut the sound (with a switch).

Now you have a very easy to use and customize software protection for doing your demo!