byulparan / cl-collider

A SuperCollider client for CommonLisp
Other
218 stars 23 forks source link

* exception in GraphDef_Load: UGen 'Control' not installed. #112

Closed tentaclius closed 2 years ago

tentaclius commented 3 years ago

Facing this issue with the newest SuperCollider engine version 3.11.2. Before system upgrade everything was working smoothly.

An attempt to create any synthdef with cl-collider fails with the exception:

Opening an issue to cl-collider, as this is the only environment I can reproduce the issue with. SuperCollider IDE and Tidal Cycles work fine.

Here how I initiate the connection:

(ql:quickload :cl-collider)                                                                                             
(ql:quickload :sc-extensions)                                                                                           
(in-package :sc-user)                                                                                                   
(use-package :sc-extensions)                                                                                            
(named-readtables:in-readtable :sc)                                                                                     
(setf *s* (make-external-server "localhost" :port 57880))                                                               
(server-boot *s*)                                                                                                       
(jack-connect) 

The terminal output is:

This is SBCL 2.0.1-5.fc34, an implementation of ANSI Common Lisp.                                                       
More information about SBCL is available at <http://www.sbcl.org/>.                                                     

SBCL is free software, provided as is, with absolutely no warranty.                                                     
It is mostly in the public domain; some portions are provided under                                                     
BSD-style licenses.  See the CREDITS and COPYING files in the                                                           
distribution for more information.                                                                                      
(ql:quickload :cl-collider)                                                                                             
(ql:quickload :sc-extensions)                                                                                           
;(ql:quickload :cl-patterns/supercollider)                                                                              
;(cl-patterns:start-backend :supercollider)  ;; start supercollider and jackd via patterns library                      
(in-package :sc-user)                                                                                                   
To load "cl-collider":                                                                                                  
  Load 1 ASDF system:                                                                                                   
    cl-collider                                                                                                         
; Loading "cl-collider"                                                                                                 
(use-package :sc-extensions)                                                                                            
(named-readtables:in-readtable :sc)                                                                                     
;                                                                                                                       
(setf *s* (make-external-server "localhost" :port 57880))                                                               
(server-boot *s*)                                                                                                       
(jack-connect)                                                                                                          
......                                                                                                                  
(:CL-COLLIDER)                                                                                                                  
* To load "sc-extensions":                                                                                              
  Load 1 ASDF system:                                                                                                   
    sc-extensions                                                                                                       
; Loading "sc-extensions"                                                                                               

(:SC-EXTENSIONS)                                                                                                        
* #<PACKAGE "SC-USER">                                                                                                  
* T                                                                                                                                                                                           
* #<NAMED-READTABLE :SC {10051CF9B3}>                                                                                                                                                         
* #<CL-COLLIDER::EXTERNAL-SERVER localhost-127.0.0.1:57880>                                                                                                                                   
* JackDriver: client name is 'SuperCollider'                                                                                                                                                  
SC_AudioDriver: sample rate = 48000.000000, driver's block size = 1024                                                                                                                        
SuperCollider 3 server ready.                                                                                                                                                                 
#<CL-COLLIDER::EXTERNAL-SERVER localhost-127.0.0.1:57880>                                                                                                                                     
* JackDriver: max output latency 21.3 ms                                                                                                                                                      
NIL                                                                                                                                                                                           
* Zeroconf: registered service 'SuperCollider'     

Then an attempt to define a synthdef:

;; Simple synth                                                                                                         
(defsynth :my-synth ((freq 440) (out 0) (gate 1) (pan 0) (amp .5))                                                      
   (let* ((env (env-gen.kr (adsr .001 .1 .4 .6) :gate gate :act :free))                                                 
          (sig (* (sin-osc.ar freq) 0.3))                                                                               
          (sig (+ sig (* (sin-osc.ar (* freq 2)) 0.2)))                                                                 
          (sig (+ sig (* (sin-osc.ar (* freq 3)) 0.1)))                                                                 
          (sig (+ sig (* (pulse.ar (* freq 1/2)) 0.03)))                                                                
          )                                                                                                             
     (out.ar out (pan2.ar sig pan (* amp env))) ))     

Results in

;; Simple synth                                                                                                         
(defsynth :my-synth ((freq 440) (out 0) (gate 1) (pan 0) (amp .5))                                                      
   (let* ((env (env-gen.kr (adsr .001 .1 .4 .6) :gate gate :act :free))                                                 
          (sig (* (sin-osc.ar freq) 0.3))                                                                                                                                                     
          (sig (+ sig (* (sin-osc.ar (* freq 2)) 0.2)))                                                                 
          (sig (+ sig (* (sin-osc.ar (* freq 3)) 0.1)))                                                                 
          (sig (+ sig (* (pulse.ar (* freq 1/2)) 0.03)))                                                                
          )                                                                                                             
     (out.ar out (pan2.ar sig pan (* amp env))) ))                                                                      
exception in GraphDef_Recv: UGen 'Control' not installed.                                                               
#<CL-COLLIDER::SYNTHDEF :name "my-synth">    

The synthdef is not available then.

* (synth :my-synth)                                                                                                     
#<CL-COLLIDER::NODE :server #<CL-COLLIDER::EXTERNAL-SERVER localhost-127.0.0.1:57880> :id 1000 :name "my-synth">        
* *** ERROR: SynthDef my-synth not found                                                                                
FAILURE IN SERVER /s_new SynthDef not found   

Tried re-installing SuperCollider engine and cl-collider (deleting whole quicklisp folder), but this didn't help. The SuperCollider is installed as a system package of Fedora 34.

Found a few mentions of the similar issue with SC in the past, but it doesn't seem to apply, I removed all previously installed SC plugins. Also the fact that SC works fine outside of cl-collider scope is strange...

Thanks!

P.S. To my surprise I faced the same issue with Overtone 0.10.6, but not with the older version (0.10.3).

byulparan commented 3 years ago

It seems cl-collider can't found sc plugin directory. Look sc-user::*sc-plugin-paths* and set correct directory.

hmm...maybe SuperCollider's plugin path changed(?).

byulparan commented 3 years ago

or test it.

(ql:quickload :cl-collider)

(in-package :sc-user)
(setf *sc-plugin-paths* nil)

(setf *s* (make-external-server "localhost" :port 57180))
(server-boot *s*)

then try define synth and play it. when *sc-plugin-paths* is nil, scsynth will search to plugin in standard paths.

tentaclius commented 3 years ago

Thanks a lot! Setting the plugin path to nil indeed fixed the problem. I don't think the default plugin path has changed, it's rather my previous attempts to build and install SC environment from sources messed up my environment somehow. The values in my sc-plugin-paths was pointing to /usr/local/share/SuperCollider, which is now absent.

Thanks again! And thanks for your time maintaining this awesome code!

tentaclius commented 3 years ago

User Environment problem.

byulparan commented 3 years ago

Thanks for report it! and now.... we should be consider about set default value of *sc-plugin-paths* to Nil.

in the past We should be set for sc-plugin-paths explictly, but now we can just set to Nil if use standard plugin path only.

If that's correct on all platform, I will set default value of *sc-plugin-paths* to Nil.