Create a blank instrument and run the following script. Watch for the result of a and b at a8388608. Like I said weird. It seems there is an offset around 2^23. This had me going for quite a while.
If you leave it running past this point it becomes ok again.
Now swap the commented line for the one above it and run again. This has been driving me mad and makes no sense to me at this late hour. Can someone explain the output this generates because I must not be thinking straight.
Code: Select all
test_var_id = am_variable_create("test_var", "INT", 0)
test = 2
am_variable_write(test_var_id, 1)
function get_am_vars(test_dr)
print("b" .. test_dr)
end
function loop()
test = test * 2
-- test = (test * 2) - 10
print("a" .. test)
am_variable_write(test_var_id, test)
end
variable_subscribe("AM", "test_var", "INT", get_am_vars)
timer_start(0, 1000, loop)