From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Creating a coding system Date: Sat, 20 Dec 2014 10:05:39 +0100 Message-ID: <87ppbeitcs.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1419066356 30881 80.91.229.3 (20 Dec 2014 09:05:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Dec 2014 09:05:56 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 20 10:05:49 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y2Fyr-0004pS-Hw for ged-emacs-devel@m.gmane.org; Sat, 20 Dec 2014 10:05:45 +0100 Original-Received: from localhost ([::1]:33867 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2Fyq-0005qb-5B for ged-emacs-devel@m.gmane.org; Sat, 20 Dec 2014 04:05:44 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2Fyn-0005qW-NJ for emacs-devel@gnu.org; Sat, 20 Dec 2014 04:05:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y2Fym-0008G6-WA for emacs-devel@gnu.org; Sat, 20 Dec 2014 04:05:41 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35451) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2Fym-0008G2-Nk for emacs-devel@gnu.org; Sat, 20 Dec 2014 04:05:40 -0500 Original-Received: from localhost ([127.0.0.1]:42627 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2Fym-00072X-3v for emacs-devel@gnu.org; Sat, 20 Dec 2014 04:05:40 -0500 Original-Received: by lola (Postfix, from userid 1000) id AFA6AE056B; Sat, 20 Dec 2014 10:05:39 +0100 (CET) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:180362 Archived-At: --=-=-= Content-Type: text/plain Ok, what am I doing wrong here? Why does decode-coding-string not do anything here? --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline; filename=midi.el Content-Transfer-Encoding: quoted-printable (define-translation-table 'midi-decode-table (make-translation-table-from-alist (mapcar (lambda (p) (cons (car p) (string-to-vector (cdr p)))) '(([144 0] . "c,,,,") ([144 1] . "des,,,,") ([144 2] . "d,,,,") ([144 3] . "es,,,,") ([144 4] . "e,,,,") ([144 5] . "f,,,,") ([144 6] . "fis,,,,") ([144 7] . "g,,,,") ([144 8] . "as,,,,") ([144 9] . "a,,,,") ([144 10] . "bes,,,,") ([144 11] . "b,,,,") ([144 12] . "c,,,") ([144 13] . "des,,,") ([144 14] . "d,,,") ([144 15] . "es,,,") ([144 16] . "e,,,") ([144 17] . "f,,,") ([144 18] . "fis,,,") ([144 19] . "g,,,") ([144 20] . "as,,,") ([144 21] . "a,,,") ([144 22] . "bes,,,") ([144 23] . "b,,,") ([144 24] . "c,,") ([144 25] . "des,,") ([144 26] . "d,,") ([144 27] . "es,,") ([144 28] . "e,,") ([144 29] . "f,,") ([144 30] . "fis,,") ([144 31] . "g,,") ([144 32] . "as,,") ([144 33] . "a,,") ([144 34] . "bes,,") ([144 35] . "b,,") ([144 36] . "c,") ([144 37] . "des,") ([144 38] . "d,") ([144 39] . "es,") ([144 40] . "e,") ([144 41] . "f,") ([144 42] . "fis,") ([144 43] . "g,") ([144 44] . "as,") ([144 45] . "a,") ([144 46] . "bes,") ([144 47] . "b,") ([144 48] . "c ") ([144 49] . "des ") ([144 50] . "d ") ([144 51] . "es ") ([144 52] . "e ") ([144 53] . "f ") ([144 54] . "fis ") ([144 55] . "g ") ([144 56] . "as ") ([144 57] . "a ") ([144 58] . "bes ") ([144 59] . "b ") ([144 60] . "c'") ([144 61] . "des'") ([144 62] . "d'") ([144 63] . "es'") ([144 64] . "e'") ([144 65] . "f'") ([144 66] . "fis'") ([144 67] . "g'") ([144 68] . "as'") ([144 69] . "a'") ([144 70] . "bes'") ([144 71] . "b'") ([144 72] . "c''") ([144 73] . "des''") ([144 74] . "d''") ([144 75] . "es''") ([144 76] . "e''") ([144 77] . "f''") ([144 78] . "fis''") ([144 79] . "g''") ([144 80] . "as''") ([144 81] . "a''") ([144 82] . "bes''") ([144 83] . "b''") ([144 84] . "c'''") ([144 85] . "des'''") ([144 86] . "d'''") ([144 87] . "es'''") ([144 88] . "e'''") ([144 89] . "f'''") ([144 90] . "fis'''") ([144 91] . "g'''") ([144 92] . "as'''") ([144 93] . "a'''") ([144 94] . "bes'''") ([144 95] . "b'''") ([144 96] . "c''''") ([144 97] . "des''''") ([144 98] . "d''''") ([144 99] . "es''''") ([144 100] . "e''''") ([144 101] . "f''''") ([144 102] . "fis''''") ([144 103] . "g''''") ([144 104] . "as''''") ([144 105] . "a''''") ([144 106] . "bes''''") ([144 107] . "b''''") ([144 108] . "c'''''") ([144 109] . "des'''''") ([144 110] . "d'''''") ([144 111] . "es'''''") ([144 112] . "e'''''") ([144 113] . "f'''''") ([144 114] . "fis'''''") ([144 115] . "g'''''") ([144 116] . "as'''''") ([144 117] . "a'''''") ([144 118] . "bes'''''") ([144 119] . "b'''''"))))) (define-coding-system 'midi "This converts Midi note-on events to note names" :mnemonic ?M :coding-type 'charset :eol-type 'unix :decode-translation-table 'midi-decode-table :mime-text-unsuitable t) (prin1 (decode-coding-string "\220\040" 'midi)) ;(make-serial-process :port "/dev/snd/midiC1D0" ; :speed nil ; :coding 'midi ; :noquery t) --=-=-= Content-Type: text/plain -- David Kastrup --=-=-=--