Version: 1.05 (alpha)
Author: numa.tortolero@gmail.com
This Emacs configuration file allows you to interact with FoxDot (http://foxdot.org) for live coding patterns.
Inspiration: tidal.el (from TidalCycles project), hsc3.el (form hsc3 project) and foxdot-mode.
SuperCollider, python with FoxDot library. You will need too python package for Emacs; this comes with your Emacs distribution.
We assume that you are working in Linux.
If you want FoxDot launch when you open "myfile.foxdot", add the following lines to ~/.emacs:
(add-to-list 'auto-mode-alist '("\\.foxdot)?$" . foxdot-mode))
(add-hook 'foxdot-mode-hook 'foxdot)
If you do this, don't need use
Alt-x foxdot ENTER
to start FoxDot. The sclang and FoxDot interpreter will launch when you open a .foxdot file. If you have problem with foxdot-sc3-mode and want use an external instance of sclang or scsynth, do:
(add-to-list 'auto-mode-alist '("\\.foxdot)?$" . foxdot-mode))
(add-hook 'foxdot-mode-hook 'foxdot-start-foxdot)
I have cloned the foxdot-mode repository in "~/.emacs/site-lisp" path and added these lines to my ~/.emacs file:
(add-to-list 'load-path (expand-file-name "site-lisp/foxdot-mode" user-emacs-directory))
(require 'foxdot-mode)
(add-to-list 'auto-mode-alist '("\\.foxdot)?$" . foxdot-mode))
(add-hook 'foxdot-mode-hook 'foxdot\)
Now, when I open a .foxdot file in Emacs, start FoxDot, creates a *FoxDot* process and I can write and evaluate my livecoding lines, seting the cursor over the line that I want execute and using the folowing keys:
C-c C-c (foxdot-run-line). Send a line to the interpreter
C-c C-g (foxdot-run-line-and-go). Send a line to the interpreter and advance the cursor to the next non blank line.
C-c b (foxdot-run-block). Send the block where is the cursor to the interpreter.
C-c C-b (foxdot-run-block-and-go). Send the current block to the interpreter and advance to the next non blank line.
C-c n (foxdot-run-block-by-lines). Send a block line by line.
C-c o (foxdot-run-block-by-lines-and-go). Send a block line by line and go to next non empty line.
You can start sclang and foxdot interpreters with:
C-c C-s (foxdot-sc3-foxdot-start)
To quit sclang and foxdot: Alt+x kill-foxdot ENTER, or:
C-c C-k (foxdot-sc3-foxdot-quit)
Is possible interactively work with the sclang buffer, from a .sc3 or .foxdot buffer. Use the following kays:
C-z C-c (sc3-run-line). Send a line to sclang
C-z C-g (sc3-run-line-and-go). Send a line to sclang and advance the cursor to the next non blank line.
C-z b (sc3-run-block). Send the block where is the cursor to sclang.
C-z C-b (sc3-run-block-and-go). Send the current block to sclang and advance to the next non blank line.
C-z C-u (sc3-hush). Mute sclang.
Other intesting keys:
C-c s (foxdot-sc3-start). Run sclang only.
C-c k (foxdot-sc3-kill). Kill sclang only.
C-c f (foxdot-start-foxdot). Run python foxdot only.
C-c q (foxdot-kill-foxdot). Kill python foxdot only.
Layouts:
foxdot-mode can show three layouts:
C-c w (foxdot-set-sc3-layout). Three vertical windows: workspace, foxdot and sclang.
C-c C-w (foxdot-set-foxdot-layout). Two windows: workspace and foxdot.
C-c 3 (foxdot-sc3-foxdot-layout). Two windows: workspace and sclang.
This code is in alpha state, is not very tested (December, 2021).
Thanks to Jean Argenty from TOPLAB for its ideas and help testing this codes.