all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: joakim@verona.se
Cc: emacs-devel@gnu.org
Subject: Re: Integrating Midi into Emacs
Date: Fri, 09 Jan 2015 22:59:58 +0100	[thread overview]
Message-ID: <87lhlbmx7l.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <m31tn3sl9t.fsf@exodia.verona.se> (joakim@verona.se's message of "Fri, 09 Jan 2015 22:21:18 +0100")

[-- Attachment #1: Type: text/plain, Size: 2220 bytes --]

joakim@verona.se writes:

> David Kastrup <dak@gnu.org> writes:
>
>> I've been meddling with CCL programs and stuff for integrating Midi
>> input received via make-serial-process into Emacs.  I've encountered
>> several puzzling design decisions and drawbacks.
>>
>> There are several crucial ones, however.  At its core, pressing keys
>> on a musical keyboard will result in the insertion of note names into
>> the current buffer.  This basically is similar to an input method.

>> c) the inserted text actually depends on buffer-local variables, for
>> example the current notename language (English writes cs for c-sharp,
>> Dutch writes cis, Italian writes dod), and the current key (the Midi
>> event for c-sharp is indistinguishable from d flat, and the decision is
>> made based on the current key in the current piece).  Switching CCL
>> programs in the decoder is tricky as they do not lend themselves to
>> closures with internal states.  Also, one would need one closure per
>> language/key pairing currently active.
>>
>> This kind of flexible back-and-forth mapping is actually better
>> accomplished by swapping around keymaps rather than encodings.
>>
>> What this leads up to is that a better approach would be to have Midi
>> events in the Emacs event queue.
>>
>> Thoughts?
>
> Since you said "Thoughts", I have some.
>
> - I'm building a combined computer/midi keyboard, and it would
>   be really nice to use it with emacs with your idea. (If I ever manage
>   to finish the project)
>
> - I'm sure you considered OSC, but heres a link anyway:
>   http://delysid.org/emacs/osc.el

Never heard of it.  I'll take a look eventually.

> My idea with OSC was to embedd gtk sliders in a buffer, and drive a
> softsynth made with Overtone with these sliders using OSC.
>
> Anyway, good luck with your project!

Here is the current pitch I am working with without recompiling the
binary, so obviously not taking modifier keys or timings at the moment.
Also, no strategy yet for encoding key-release events.

You just call M-x midikbd-open RET, specify a raw midi device (if
necessary, provided by the snd-virmidi module), and then you can choose
yourself how you are going to bind the resulting key events.


[-- Attachment #2: midi-kbd.el --]
[-- Type: application/emacs-lisp, Size: 5160 bytes --]

[-- Attachment #3: Type: text/plain, Size: 294 bytes --]


Of course this is ongoing work, but what I got here is a nice
self-contained module doing exactly one job, that of delivering events.
And obviously, if one were to write native Midi support, that's exactly
the scope of what this native Midi support would be supposed to do.

-- 
David Kastrup

  reply	other threads:[~2015-01-09 21:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-02 11:28 Integrating Midi into Emacs David Kastrup
2015-01-02 13:24 ` davi
2015-01-02 21:11 ` Christopher Allan Webber
2015-01-03  9:27   ` David Kastrup
2015-01-09 21:21 ` joakim
2015-01-09 21:59   ` David Kastrup [this message]
2015-01-10  8:32     ` joakim
2015-01-14  9:42       ` Niels Giesen
2015-01-14 10:49         ` David Kastrup
2015-01-14 11:20           ` David Kastrup
2015-01-09 22:06   ` David Kastrup
2015-01-10  8:28     ` joakim

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=87lhlbmx7l.fsf@fencepost.gnu.org \
    --to=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=joakim@verona.se \
    /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.