Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sonic-pi-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
(define-key map (kbd "C-c M-c") 'sonic-pi-connect)
(define-key map (kbd "C-c C-k") 'sonic-pi-send-buffer)
(define-key map (kbd "C-c C-r") 'sonic-pi-send-region)
(define-key map (kbd "C-c C-w") 'sonic-pi-send-line)
(define-key map (kbd "C-c C-q") 'sonic-pi-quit)
(define-key map (kbd "C-c C-b") 'sonic-pi-stop-all)
(define-key map (kbd "C-c C-c") 'sonic-pi-send-live-loop)
Expand Down
9 changes: 8 additions & 1 deletion sonic-pi-osc.el
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@
(hlt-highlight-regexp-region (region-beginning) (region-end) ".+" 'eval-sonic-pi-flash nil)
(run-at-time flash-time nil 'hlt-unhighlight-region nil nil nil))

(defun sonic-pi-send-line ()
"send a line to sonic via osc"
(interactive)
(sonic-pi-osc-send-text (line-beginning-position) (line-end-position))
(hlt-highlight-regexp-region (line-beginning-position) (line-end-position) ".+" 'eval-sonic-pi-flash nil)
(run-at-time flash-time nil 'hlt-unhighlight-region nil nil nil))

(defun sonic-pi-send-buffer ()
"send the current buffer to sonic via osc"
(interactive)
Expand All @@ -95,7 +102,7 @@
"send a live-loop to sonic via osc"
(interactive)
(save-excursion
(let ((s (re-search-backward "^\\(live_loop\\|with_fx\\)")))
(let ((s (re-search-backward "^\\(live_loop\\|with_fx\\|in_thread\\|define\\)")))
(ruby-end-of-block)
(end-of-line)
(sonic-pi-osc-send-text s (point))
Expand Down