all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: schwab@linux-m68k.org, emacs-devel@gnu.org
Subject: Re: Creating a coding system
Date: Sat, 20 Dec 2014 20:06:45 +0100	[thread overview]
Message-ID: <87egrugmyi.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <83mw6iqicx.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 20 Dec 2014 20:35:58 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: David Kastrup <dak@gnu.org>
>> Cc: schwab@linux-m68k.org,  emacs-devel@gnu.org
>> Date: Sat, 20 Dec 2014 18:38:23 +0100
>> 
>> Huh.  I'll look again, but I _did_ look in the manual previously.  Maybe
>> a coding system is not even the right way to do this
>
> Well, as I wrote elsewhere, I don't really understand what "this" is,
> so please consider elaborating.

Midi is a real-time byte-oriented protocol conveying musical data and is
primarily used for hooking up Midi-code generating keyboards with
Midi-playing devices (originally, a serial protocol at something like
31250  Baud over galvanically separated current-loop).

<URL:http://www.gweep.net/~prefect/eng/reference/protocol/midispec.html>
contains some useful information.  The raw midi messages, as read from a
midi device, contain information like "key-on on channel #9 with pitch
#83 and velocity #112".  Command bytes are #128 to #255, data bytes are
#0 to #127 and most commands come with a fixed amount of data anyway.
So resynchronization for lost bytes is usually immediate.

There are also Midi _files_: those contain additional data, most
particularly an encoding of the _timing_ of events (because as opposed
to ordinary written text, the timing of events is crucial for Midi).
Those are, more or less, the preferred storage format for "Midi
sequencers" which are able to produce or reproduce a timed stream of raw
Midi events.

There is some age-old application called "rumor" that converts Midi
messages into input for the music typesetter LilyPond, and rumor can be
hooked up with some Emacs mode.  All that is pretty arcane and not all
that well-supported.

Since Emacs can use make-serial-process for opening a raw Midi port, the
idea was to bypass the additional executable and create an application
useful for directly interfacing with Midi keyboards so that one can at
least key in pitches faster than by using a computer keyboard.

Part of the reason this may be faster than a computer keyboard is that
the typical musician looks at a score, employs some cognitive
processing, names the resulting pitch, translates it into LilyPond's
representation of a pitch (see
<URL:http://www.lilypond.org/doc/v2.19/Documentation/notation/writing-pitches>)
and then types it in using multiple keypresses.

With a Midi keyboard, typing the pitch entails looking at the score and
typing a single key (or a whole sequence of keys) using pretrained
visual/motoric connections.

Now the first iteration would be just using the pitches from a Midi
keyboard.  The second iteration would then try working with durations.
Either by putting time stamps on the events as they trundle in, or by
reading from a "cooked" Midi stream already containing encoded time time
stamps.

Conversion of time stamps to musical durations, particularly when the
time stamps have not been generated by a notation program but by a human
player, is non-trivial and would hopefully end up as an incremental
process where a human corrects durations and Emacs improves its overall
guesswork.

But time stamps are for another time.  Right now I'd be glad just to
convert the pitches from they keyboard into LilyPond's pitch notation in
order to make key entry faster.

-- 
David Kastrup



  reply	other threads:[~2014-12-20 19:06 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-20  9:05 Creating a coding system David Kastrup
2014-12-20 10:20 ` Thien-Thi Nguyen
2014-12-20 10:42   ` David Kastrup
2014-12-20 13:51 ` Andreas Schwab
2014-12-20 14:19   ` David Kastrup
2014-12-20 14:50     ` Eli Zaretskii
2014-12-20 15:56     ` Thien-Thi Nguyen
2014-12-20 16:11     ` Andreas Schwab
2014-12-20 16:14     ` Andreas Schwab
2014-12-20 16:43       ` David Kastrup
2014-12-20 16:53         ` Eli Zaretskii
2014-12-20 17:38           ` David Kastrup
2014-12-20 18:31             ` Stephen J. Turnbull
2014-12-20 18:40               ` David Kastrup
2014-12-20 18:35             ` Eli Zaretskii
2014-12-20 19:06               ` David Kastrup [this message]
2014-12-20 20:02                 ` Eli Zaretskii
2014-12-20 20:11                   ` David Kastrup
2014-12-20 20:45                     ` Eli Zaretskii
2014-12-20 21:15                       ` David Kastrup
2014-12-21 19:46                         ` David Kastrup
2014-12-21 21:25                       ` David Kastrup
2014-12-21  5:54                 ` Stephen J. Turnbull
2014-12-20 16:21     ` Stephen J. Turnbull
2014-12-20 16:52       ` David Kastrup
2014-12-20 18:34         ` Eli Zaretskii
2014-12-20 18:42           ` David Kastrup
2014-12-23  8:59 ` K. Handa
2014-12-23  9:25   ` David Kastrup
2014-12-24 15:06     ` K. Handa
2014-12-25  6:39       ` David Kastrup
2014-12-29 14:11         ` K. Handa
2014-12-29 14:25           ` David Kastrup

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87egrugmyi.fsf@fencepost.gnu.org \
    --to=dak@gnu.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.