script and pd patch for MID keyboard