reddit / emacs

Emacs MIDI input

lets-start-reading · 2022-01-25 10:30
hello, dears. I'm on a quest. I've been travelling for a while. And I might be closing on its end, I feel. With Emacs. I have MIDI devices connected to a Macbook. I need Emacs to listen to their MIDI events and insert as text. Simple. Just letters or numbers. Google has brought me to these ways: \- [emacswiki](https://www.emacswiki.org/emacs/EmacsMidi), [emaccordion](https://github.com/jnykopp/emaccordion), [midimacs](https://github.com/andreasjansson/midimacs), [midi-kbd](https://elpa.gnu.org/packages/midi-kbd.html) : based on ALSA (linux), unavailable in Mac OS X. \- [(make-serial-port)](https://www.gnu.org/software/emacs/manual/html_node/elisp/Serial-Ports.html) : MIDI devices are generally USB, not serial. ​ Could someone point me in the right direction?
art_else · 2022-01-25 15:49
You could perhaps [setup](https://elpa.gnu.org/packages/osc.html) an OSC (OpenSoundControl) bridge?
lets-start-reading · 2022-01-25 18:41
That's my first idea and I will set it up regardless : send osc packets Max->emacs. Nevertheless, I'm also looking for a solution that's · more portable and · instructive as to emacs scripting and lower-level bearings of such tasks.
[deleted] · 2022-01-25 20:24
[deleted]
lets-start-reading · 2022-01-25 22:30
I want to make myself a system where I could use a text-focused environment to store and manage my musical ideas, projects, and libraries, as well as experiment more freely with sequence juxtapositions and superpositions, as well as utilise the power of lisp for this same purpose. And Lilypond! I also intend to get into SuperCollider (cl-collider), and having a one-way street of midi seems conceptually lighter. Part of this wish for an input straight to emacs may be just intellectual curiosity as well. I guess OSC should work just fine.
art_else · 2022-01-25 23:23
Would have been great if a MIDI device would just mount itself as a device in '/dev/'..
brimspade · 2022-12-23 18:00
Hey, have you found a solution? I seems easier to set up on Linux. because midi-kbd expects a device /dev/snd/midi, but on Macos, there is no such file. Please tell me if you found a way.
lets-start-reading · 2022-12-23 18:18
I stopped using emacs in the meantime. But indeed the OSC solution should work. The only thing you'd need is to listen to the input midi stream and generate osc messages – not too difficult to cook up in Swift (although its use of pointers is confusing) – it can use CoreMIDI natively. There are a few libraries for this, as well.