Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with sending a buffer #20

Closed
greenfork opened this issue Nov 12, 2017 · 7 comments
Closed

Issue with sending a buffer #20

greenfork opened this issue Nov 12, 2017 · 7 comments
Assignees
Labels

Comments

@greenfork
Copy link

Hi! I had an issue with sending a buffer whereas sending a region works fine. Are there any caveats of sending a region of all the buffer instead of sending the buffer as a file? Is this a common problem?

And if it's ok, can I suggest a pull request of reimplementing the sonic-pi-send-buffer function in sonic-pi-osc.el?

@mbutz
Copy link

mbutz commented Nov 16, 2017

Can confirm that. 'sonic-pi-send-buffer' does not do anything anymore.

@greenfork
Copy link
Author

@mbutz I'm currently using this replacement if you are interested

(defun sonic-pi-send-full-buffer ()
  "send full buffer selecting region of full buffer"
  (interactive)
  (sonic-pi-osc-send-text (point-min) (point-max))
  (hlt-highlight-regexp-region (point-min)
                               (point-max)
                               ".+"
                               'eval-sonic-pi-flash nil)
  (run-at-time flash-time nil 'hlt-unhighlight-region nil nil nil))

(add-hook 'sonic-pi-mode-hook
          (lambda ()
            (setq sonic-pi-path "/opt/sonic-pi/app/")
            (define-key sonic-pi-mode-map (kbd "C-c C-p") 'sonic-pi-stop-all)
            (define-key sonic-pi-mode-map (kbd "C-c C-k") 'sonic-pi-send-full-buffer)))

@mbutz
Copy link

mbutz commented Nov 16, 2017

Wow. Thanks! Works flawlessly.

Just out of curiosity: Can you confirm #19 or haven't you tried to use midi yet?

@greenfork
Copy link
Author

@mbutz I'm new to Sonic Pi and haven't played with the midi command yet. But yeah, I will post in #19 if I have something useful.

@josephwilk
Copy link
Member

@greenfork Any chance you have the error in the buffer? Also the version of SP you are trying to run against?

Thanks.

@josephwilk josephwilk self-assigned this Nov 17, 2017
@josephwilk josephwilk added the bug label Nov 17, 2017
@josephwilk
Copy link
Member

I believe this is an issue that SP in latest versions removed the fn save-and-run-buffer-via-local-file.

https://github.com/repl-electric/sonic-pi.el/blob/master/sonic-pi-osc.el#L61-L66

This makes me sad, since this fn fixes a big problem with SP: #21

Probably I'll fix this by resorting back to the old SP osc fn. Since most people will just want it to work (until they hit #21 and cry).

josephwilk added a commit that referenced this issue Nov 17, 2017
@josephwilk
Copy link
Member

Should be fixed now @greenfork, I'll close but feel free to re-open if I messed anything up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants