Hello Guest

Using the "g" variable

  • 2 Replies
  • 1980 Views
Using the "g" variable
« on: January 29, 2016, 07:30:52 PM »
Is there a way to put the "g" variable to use (g is a pre-defined variable that changes from 0 to 1 when you touch the xy pad).

I'd like to have the app only produce sound when your finger is on the xy pad (ie when g=1). I was thinking it would be something like an if/then statement that would make t=0 when g=0, but there are no (explicit) if/then statements in BitWiz. I'm no programmer so the bit in the FAQ that says "think functional instead of imperative programming" doesn't mean anything to me.

I'm also not sure that setting t=0 will do what I think it will. I tried multiplying the entire formula by g:

// x-y pulse click beat
((t*(5000/(t%2000+10))&t>>7)&((t*x)&t>>(y/20))|(t>>4&255))*g

...it did something, but not what I expected. Actually had slightly more interesting (ie more playable) results multiplying by h, but nothing like making the sound stop entirely.

Is "making the sound stop" even possible? Has anyone had any success using the g variable to do anything?

Thanks!

Re: Using the "g" variable
« Reply #1 on: January 29, 2016, 10:54:13 PM »
Of course, as soon as I ask, I get it working. This formula:

// touch synth v1
t=((t%(x*100))*y)*h

...is doing pretty much exactly what I want. Just need to tweak it some more to see if I can get a & b doing something (like maybe slowing the whole thing down).

Let me know if you have any suggestions!


Re: Using the "g" variable
« Reply #2 on: February 02, 2017, 05:12:46 AM »
Of course, as soon as I ask, I get it working. This formula:

// touch synth v1
t=((t%(x*100))*y)*h

...is doing pretty much exactly what I want. Just need to tweak it some more to see if I can get a & b doing something (like maybe slowing the whole thing down).

Let me know if you have any suggestions!

You might want to try the following variation:

// touch synth v1
t=((t%(x*100))*y)*h,
t=((t%(a*100))*b)*g