Global variables

guidane

2010-09-28 21:32:49

First time posters first problematic post. :D

Is there a way to store and recal the global variables?
I want to make "presets" that can change over time.

example.

if u select preset g1, ga=0 and gb =0.
while ur in preset g1 you change ga to 4 and gb to 3
if u select preset g2, ga=0 and gb=0
while ur in preset g2 you change ga to 3 and gb to 2
if u select g1 again ga shoud be 4 and gb shoud be 3 again.

if this explaination isnt clear enoug just ask :)

tnx!

guidane

2010-10-02 00:09:21

Solved it.
And here is how.

U can use an 8 digit number to store the info.
For example if used g1 to store the preset
ga,gb,gc are used to store things like volume, overdub,track select in a number.

The variables ga to gc are fist multiplyed
for example i used ga=1 gb=1 gc=3
ga*10000000
gb*100000
gc*10000

Then they are summed up together (ga+gb+gc) in g#
Resulting in g#=11300000

g1 to g8 are used to store presets seperatly
g9 is used to swap between g1 to g8
so g# is equal`d to g9

After this u can "translate" g9 back to their ga,gb, ect numbers.

example for gc
xx=g9 // witch is 11300000
xx=xx/100000 // used to get rid of not used zero`s for gc now u have 113
Label "start"
if xx>=100 then xx=xx-100 // this one get rid of the 100 in gc
if xx<=100 then skip next rule //this leaves 13
Goto "start"
if xx>=10 then xx=xx-10 //this one gets rid of the 10 in gc
if xx<=10 then skip next rule//this leaves 3
Goto "start"
gc=xx //resulting in 3

And that`s all :shock:
it might be posible that some zeros are missing in this explenation (Math....... :roll: )

Greets!!

Attigo

2010-10-06 21:22:46

Sorry buddy, a lot of this is incorrect, where are you getting this from?

cheers,
Scott

guidane

2010-10-06 23:58:39

:roll: home brew....

The only flaw i coud find was:

ga*10000000
gb*100000 <---- mising zero
gc*10000 <---- mising zero

Am i overlooking somthing?

Anyhow i`f got it working this way :)

Greets.

laila34

2010-10-15 07:15:44

Thanks guys,,
This help on my part,great share,
Godspeed!how to deal with depression