[Fluxus] emacs, osc, etc...
    alcoholiday at gmail.com 
    alcoholiday at gmail.com
       
    Wed Mar 25 09:55:07 PDT 2009
    
    
  
I just use MrEd in a COM window w/ drflux.ss
Works totally swell!
Sent via BlackBerry from T-Mobile
-----Original Message-----
From: nik gaffney <nik at fo.am>
Date: Wed, 25 Mar 2009 12:42:18 
To: chris kummerer<chris at lo-res.org>
Cc: <fluxus at pawfal.org>
Subject: Re: [Fluxus] emacs, osc, etc...
> How can an I use emacs with fluxus ? (no offense to the livecodedisplaying
> idea but I spent way too much time bashing emacs into shape, I (semi-live)
> code all the supercollider stuff there too so it would be just a perfect
i think there have been a few changes to on the fluxus side since i had
this working, but something like...
;; osc evaluator
;;   test with > sendOSC -h 127.0.0.1 88008 /code '(build-sphere 12 12)'
(define (osc-repl)
  (cond ((osc-msg "/code")
	 (display "eval..")(newline)
	 (eval-string (osc-peek)))
	((osc-msg "/ping")
	 (begin (display "ping... ")
		(newline)))))
(osc-source "88008")
(add-frame-function (osc-repl))
.. .. and on the emacs side, something like.. .
(require 'osc) ;; see http://delysid.org/emacs/osc.html
(setf fluxus-client (osc-make-client "localhost" 88008))
(defun fluxus-send-text (start end)
  (osc-send-message fluxus-client
		    "/code"
		    (buffer-substring-no-properties start end)))
(defun fluxus-send-region ()
  "send a region to fluxus via osc .."
  (interactive)
  (fluxus-send-text (region-beginning) (region-end)))
(defun fluxus-send-buffer ()
  "send the current buffer to fluxus via osc.. ."
  (interactive)
  (fluxus-send-text (point-min) (point-max)))
(defun fluxus-send-via-shell (start end)
  (shell-command-on-region start end
			   "sendOSC -h 127.0.0.1 88008 /code "))
(defun osc-make-client (host port)
  (make-network-process
   :name "OSC client"
   :host host
   :service port
   :type 'datagram
   :family 'ipv4))
(defun fluxus-cleanup ()
   (delete-process fluxus-client))
    
    
More information about the Fluxus
mailing list