[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Integrating Midi into Emacs

From: David Kastrup
Subject: Re: Integrating Midi into Emacs
Date: Fri, 09 Jan 2015 22:59:58 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

address@hidden writes:

> David Kastrup <address@hidden> 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: midi-kbd.el
Description: application/emacs-lisp

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 via email to

[Prev in Thread] Current Thread [Next in Thread]