Skip to content
Oeiuwq Faith Blog OpenSource Porfolio

repl-electric/sonic-pi.el

Emacs running SonicPi

repl-electric/sonic-pi.el.json
{
"createdAt": "2014-09-25T10:11:46Z",
"defaultBranch": "master",
"description": "Emacs running SonicPi",
"fullName": "repl-electric/sonic-pi.el",
"homepage": "",
"language": "Emacs Lisp",
"name": "sonic-pi.el",
"pushedAt": "2024-06-19T16:07:15Z",
"stargazersCount": 91,
"topics": [
"emacs",
"livecoding",
"sonic-pi"
],
"updatedAt": "2025-05-02T12:20:53Z",
"url": "https://github.com/repl-electric/sonic-pi.el"
}

A Emacs plugin to enable live coding music in Ruby communicating with SonicPi.

SonicPi (http://sonic-pi.net/) was created by Sam Aaron.

Prerequisites:

Terminal window
git clone git@github.com:samaaron/sonic-pi.git
cd sonic-pi && app/server/bin/compile-extensions.rb
git clone git@github.com:repl-electric/sonic-pi.el.git ~/.sonic-pi.el

Install the required packages

M-x package-install dash
M-x package-install osc

Add to your emacs init.el

(add-to-list 'load-path "~/.sonic-pi.el/")
(require 'sonic-pi)
(setq sonic-pi-path "SONIC-PI-INSTALL-DIR/") ; Must end with "/"
;; Optionally define a hook
(add-hook 'sonic-pi-mode-hook
(lambda ()
;; This setq can go here instead if you wish
(setq sonic-pi-path "SONIC-PI-INSTALL-DIR/")
(define-key ruby-mode-map "\C-c\C-b" 'sonic-pi-stop-all)))

Start emacs emacs my-first-sonic-pi.rb

M-x sonic-pi-mode
M-x sonic-pi-jack-in
;;OR if you are already running sonic-pi-server
M-x sonic-pi-connect
;;Send buffer to sonic-pi
C-c C-k