DIY sysex fader box status and questions.

Jay Vaughan jayv at synth.net
Sat Apr 21 14:34:37 CEST 2012


BTW, your earlier attachment didn't come through, or I'd read the code and find out for myself the exact details.  I see now that you mention you're reading  "32 digital inputs with a shift function", which sounds quite curious to be honest .. ;)

j.

On Apr 21, 2012, at 2:31 PM, Jay Vaughan wrote:

>> OK, so i put the 2 bits for each pot together and make it a word? Isn't that the same as an int? So i end up with a value of 0 to 3. look at previous value and go from there. (can I put 4 bytes into 1 word? what is the benefit of doing this?)
> 
> I'm sorry Tom, I misunderstood what you said and thought you were getting 4 bytes from the decoder, when in fact you're getting 4 bits.  ;)  I guess I was thrown off by your representation here:
> 
> 2 bits per encoder
> Sequence CW rotation:
> 00 10 11 01
> Sequence CCW rotation:
> 00 01 11 10
> 
> .. which is in fact, binary coding (right?), so you have just one byte.  But, even then, can you  not just treat it as a const char and base a switch/if-else sequence off of it?
> 
> Its been too long since I've had to deal with reading the encoders myself on my MIDI shield for Arduino - but I see that in my current project I just collect the bytes using analogRead(KNOB1)/KNOB2 and I end up with a long val .. perhaps you can look at the low-level details in the Arduino analogRead() library function to see how the bit-fiddling is dealt with there?
> 
> 
> ;
> --
> Jay Vaughan
> 
> 
> 
> 
> _______________________________________________
> music-bar mailing list
> music-bar at lists.music-bar.org
> http://lists.music-bar.org/cgi-bin/mailman/listinfo/music-bar

;
--
Jay Vaughan






More information about the music-bar mailing list