What am I doing wrong, this seems so basic...

Discuss problems and solutions.
Post Reply
mh175
Newbie
Posts: 23
Joined: 06 Oct 2012 16:42

What am I doing wrong, this seems so basic...

Post by mh175 »

(see attachment)

I have a project variable 'var'

I have a fader, 'Fader'. The fader has a 5 step grid.

I have a pad, 'pad', that responds to Fader x position, and changes the value of 'var'.

Code for Pad:

Code: Select all

if (Fader.x=0)var=1;
if (Fader.x=.25)var=2;
if (Fader.x=.5)var=3;
if (Fader.x=.75)var=4;
if (Fader.x=1)var=5;
What keeps happening is that var gets stuck at 5, and every time I hit Pad, Fader jumps to 1.
Attachments
Bug.jzml
(5.45 KiB) Downloaded 80 times
Macciza
Regular
Posts: 1315
Joined: 07 Dec 2011 04:57
Location: Sydney, Australia.

Re: What am I doing wrong, this seems so basic...

Post by Macciza »

Hi

It works fine but your not telling it the right thing . . . .
= is assignment
== is comparison

Try if (Fader.x==0)var=1; etc . . .

Cheers
MM
iMac 2.8G i7 12G 10.6.8/10.7.2, Legacy Dexter/Lemur, Liine Lemur/iPad2, KMI SoftStep, 12Step & QuNeo , B-Controls, Mackie C4 etc
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]
mh175
Newbie
Posts: 23
Joined: 06 Oct 2012 16:42

Re: What am I doing wrong, this seems so basic...

Post by mh175 »

Thank you!
I need to look that up again.
Post Reply