Hi Fredrik, long time no see :-)
Actually, it's a great help just to know that it (probably) *should*
work. I'm pretty sure I followed all the helpful advice from blackrain
and also stefan kersten, but it looks like I need to put on my
monocle, raise my eye brow extra high, and do it from scratch once
again. Scel does work in Terminal, so I would like to think that I'm
almost there. The library seems to compile ok. Problem is that
something tries to connect to the WindowServer when I boot an SC
server in scel under >console. When I boot Server.internal, I get
"INIT_Processeses(), could not establish the default connection to
the WindowServer" and then "SCLang abort trap". When I boot
Server.local, I "only" get the WindowServer error, no abort trap.
Tom, yes, I changed Main.sc to load a file I called
~/sclang/docs/startup.sc instead of ~/scwork/startup.rtf. And I
commented out the make server window lines in Main.sc (see my entire
Main.sc below).
The startup.sc file is stripped down to this:
Server.program = "scsynth";
Server.default = s = Server.internal;
s.boot;
I also followed your tip from a while ago and removed MacUGens. So
maybe something did change in sclang...
Ok, for the record let's see what else I did...
Source code first.
Changed this in SuperCollider3/source/lang/LangSource/cmdLineFuncs.cpp:
#ifdef SC_DARWIN
# define USE_SC_TERMINAL_CLIENT 1 /* <-- changed from 0 to 1 */
#else
# define USE_SC_TERMINAL_CLIENT 1
#endif
In Xcode 1.5 I did the following in xSC3lang:
Project->Add Files
SC_TerminalClient.cpp from source/lang/LangSource/ to sclang target
-> Sources
SC_TerminalClient.h from headers/lang/ to sclang target -> Headers
SC_LanguageClient.cpp from source/lang/LangSource/ to sclang target
-> Sources
SC_LanguageClient.h from headers/lang/ to sclang target -> Headers
I'm not a virtuoso in Xcode, but as scel works in Terminal, I think I
did it right.
Someone mentioned this:
In SC_Speech.cpp: comment out method: void initSpeechPrimitives()
Actually I don't think I did that. Does that matter, and if so,
exactly which lines should I get rid of?
After building...
Of course, SCClassLibrary, synthdefs, Help, plugins and sounds dirs,
plus sclang and scsynth are all in directory ~/sclang
And all the *.el files are in ~/emacs
SuperCollider3/linux/scel/sc moved to ~/sclang/SCClassLibrary
~/.bash_profile looks like this:
PATH=$PATH:/Users/scel/sclang
export PATH
~/.emacs looks like this:
(add-to-list 'load-path "~/emacs")
(require 'sclang)
(custom-set-variables
;; custom-set-variables was added by Custom -- don't edit or
cut/paste it!
;; Your init file should contain only one such instance.
'(transient-mark-mode t))
(custom-set-faces
;; custom-set-faces was added by Custom -- don't edit or cut/paste
it!
;; Your init file should contain only one such instance.
)
~/emacs/sclang-vars.el looks like this - to be honest I'm not 100%
sure this is correct:
(defconst sclang-system-data-dir "@PKG_DATA_DIR@"
"~/sclang")
(defconst sclang-system-help-dir "@PKG_DATA_DIR@/Help"
"~/sclang/Help")
(defconst sclang-system-extension-dir "@PKG_DATA_DIR@/Extensions"
"~/sclang/SCClassLibrary/sc")
(provide 'sclang-vars)
Reading the advice of our very helpful friend, blackrain, there should
be something like this:
(defcustom sclang-help-path (list "@PKG_DATA_DIR@/Help"
"~/sclang/Help")
How does that work?
Last thing: I don't have any ~/.sclang.cfg
I experimented with different paths, but finally deleted the file, and
then scel worked in Terminal. But not in >console. (Doesn't work in
console *with* the config file either).
My entire Main.sc looks like this:
Main : Process {
var argv;
startup {
super.startup;
Document.startup;
// set the 's' interpreter variable to the default server.
interpreter.s = Server.default;
// make server window
//Server.internal.makeWindow;
//Server.local.makeWindow;
//"~/scwork/startup.rtf".loadPaths;
"~/sclang/docs/startup.sc".loadPaths;
StartUp.run;
}
shutdown { // at recompile, quit
Server.quitAll;
HIDDeviceService.releaseDeviceList;
super.shutdown;
}
run { // called by command-R
}
stop { // called by command-.
SystemClock.clear;
AppClock.clear;
TempoClock.default.clear;
CmdPeriod.clear;
Server.freeAll; // stop all sounds on local servers
Server.resumeThreads;
}
recvOSCmessage { arg time, replyAddr, msg;
// this method is called when an OSC message is received.
OSCresponder.respond(time, replyAddr, msg);
}
recvOSCbundle { arg time, replyAddr ... msgs;
// this method is called when an OSC bundle is received.
msgs.do({ arg msg;
this.recvOSCmessage(time, replyAddr, msg);
});
}
newSCWindow {
SCWindow.viewPalette;
SCWindow.new.front;
}
argv {
^argv ?? { argv = this.prArgv }
}
// PRIVATE
prArgv {
_Argv
^[ ]
}
}