--- a/mt-32-display.cpp Tue May 19 16:03:25 2020 +0200
+++ b/mt-32-display.cpp Tue May 19 17:04:22 2020 +0200
@@ -28,8 +28,16 @@
* If the checksum is wrong, the MT-32 unit shows the "Exc. Checksum error" message for few seconds
* and then returns back to the default screen.
*
- * Usage:
+ * Only printable ASCII characters are supported. Other characters (bytes) are replaced by "."
+ *
+ * Some characters are displayed differently:
+ * ASCII MT-32
+ * ~ →
+ * \ ¥
+ *
+ * Usage examples:
* amidi --port="hw:2,0,0" --send-hex="$(echo -n ' Run GNU/Linux ' | ./mt-32-display )"
+ * while read message; do amidi --port="hw:2,0,0" --send-hex="$(echo -n "$message" | ./mt-32-display )"; done
*
* @param argc
* @param argv
@@ -47,6 +55,7 @@
sum += 0x00;
for (char ch; std::cin.read(&ch, 1).good();) {
+ if (ch < 32 || ch > 126) ch = '.';
std::cout << std::setw(2) << ((int) ch) << " ";
sum += ch;
}