blob: 11fdd6fe3f0ff85dbe7a96bd9179431f0bb64f1d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
* norns etc
Three scripts useful for local development on norns (i.e., outside of the ~maiden~ web interface):
+ ~norns_shell~: Get a lua shell or supercollider shell on a norns from the command-line, similar to the shell in the maiden interface. This connects to the same websocket interface that ~maiden~ does.
#+BEGIN_SRC sh
# get a lua shell
./norns_shell
./norns_shell ws://norns.local:5555
# get a supercollider shell
./norns_shell ws://norns.local:5556
#+END_SRC
+ ~norns_upload~: Upload a file to norns over http, just like how ~maiden~ does it.
+ ~norns_load~: Activate a norns script already on the device with ~norns.script.load(...)~ on the lua interface.
~norns_shell~ requires nanomsg. ~norns_upload~ requires jq and curl. Install everything with ~sudo make install~.
There's an example in ~example/~ of a project with a Makefile that uploads and loads when ~M-x compile~'d in emacs. This piece of emacs lisp may be helpful if you'd like to ~C-c C-c~ instead.
#+BEGIN_SRC lisp
(defun recursive-upwards-compile ()
(interactive)
(if (string-prefix-p "make" compile-command)
(let ((directory (locate-dominating-file default-directory "Makefile")))
(when directory
(cd directory)
(compile compile-command)
(message directory)))
(compile compile-command)))
(add-hook 'lua-mode-hook
(lambda ()
(local-set-key (kbd "C-c C-c") 'recursive-upwards-compile)))
#+END_SRC
|