DIY sysex fader box status and questions.
ToAd
tom.adam at thebigear.be
Sat Apr 21 15:43:08 CEST 2012
On 21/04/2012 14:59, Jay Vaughan wrote:
> Its 8-bits, so that makes a byte of data to be evaluated. Each turn, you get a unique number - simply switch() on this number and off you go. Ignore the numbers you don't care about (all 1's) or use it to reset your state machine but either way - you don't need to over-think this too much. 8 bits of info is a nice, round number - use it to prompt your case, and promote the values into something more useful for your sysex-stuffing ..
>
> ;
> --
> Jay Vaughan
>
>
>
>
> _______________________________________________
> music-bar mailing list
> music-bar at lists.music-bar.org
> http://lists.music-bar.org/cgi-bin/mailman/listinfo/music-bar
Does this imply me to write 156 switch cases?
I was thinking something in these lines:
Turning pot slow gives this:
01111111
11111111
00111111
11111111
10111111
11111111
11111111 - with the program I wrote I only show the values when
something changed, so this line and the next one are not printed
11111111
01111111
11111111
Removing the all 1 bytes
01
00
10
01
Turning in the other direction gives this:
10
00
01
10
So I would do something like this:
if byte=11111111
break
else
byte for 1=0&j=1;i<=6&j,=7; 1=1+2&j=j+2 //here I'm trying to read the
bit pairs ;-)
intA=biti
intB=bitj
int oldA
int oldB
if ((oldA==1)&&(A==0)
if (B==0) encoderi +
else encoderi-
if((oldA==0)&&(A==0)
if(B==0) encoderi+
else encoderi-
if A==1&&B==0
if(oldB==0 encoderi+
else encoderi-
I would need to create an oldByte to store the old values in. The reselt
would be something like "++--" that I need to put somewhere. I thought
an array would be nice for further calculations and or look up.
Now only to get this into arduino language ;-)
Cheers,
ToAd
More information about the music-bar
mailing list