desc:Examine midi messages (http://www.midi.org/about-midi/table1.shtml)

slider1:0<0,255,1>sample offset within @block
slider2:0<0,255,1>status byte
slider3:0<0,127,1>data byte 1 (often note number)
slider4:0<0,127,1>data byte 2 (often velocity)
slider5:0<0,16,1>status high bits
slider6:0<0,16,1>status low bits (often channel)
slider7:0<0,8,1{-,note off,note on,poly aftertouch,control change,program change,channel aftertouch,pitch wheel,system special}>status high bits interpretation

// Data byte high bit is used for system exclusive messages, 
// we're ignoring it here.

@block

  while (
    midirecv(mpos, msg1, msg23) ? (
      midisend(mpos, msg1, msg23);
  
      status = msg1;

      statusHi = (msg1 / 16) | 0;
      statusLo = msg1 - (statusHi * 16);     

      data2 = (msg23 / 256) | 0;
      data1 = msg23 - (data2 * 256);

      /*
      You could reassemble the message like this.
      msg1 = (statusHi * 16 + statusLo) | 0;
      msg23 = (data2 * 256 + data1) | 0;
      */

      slider1 = mpos;
      slider2 = status;
      slider3 = data1;
      slider4 = data2;
      slider5 = statusHi;
      slider6 = statusLo;
      slider7 = statusHi - 7;

      sliderchange(255);  // We changed all the sliders.
    );
  );
       


