|
resources
Coding
Electronics
PmWiki
SuperCollider3
|
SC3: Tips for using the startup.rtf file and using symbolic linksLast Updated 18-Feb 2005
.: Symbolic Links & SC3 :.
Setting up your file structure correctly by using symbolic links and your startup.rtf file can help prevent you from erasing important files by accident when you update or reinstall SuperCollider source code. I've found it most useful to use these methods to link to folders that are located safely and soundly in a folder called 'scwork' in your '~username' folder.
Symbolic LinksI use symbolic links to remotely load my own classes into the 'DefaultLibary'. Symbolic links and aliases are basically the same, except that programs like SuperCollider are unable follow the alias to the correct folder. Instead you have to use a symbolic link which can only be made by typing a single command in the Terminal window, and which then shows up just like an alias on the desktop. Here's how to get your homemade class definitions and additions to correctly load when you startup or recompile SC3:
ln -s sourceFile targetFile
or as it looked when I did it...
ln -s /Users/aoverton/scwork/aoSC_library /Applications/Apps.Audio/SuperCollider3/build/SCClassLibrary/DefaultLibrary/
It's actually pretty important that you DON'T have an ending slash ( aoSC_library/ as opposed to aoSC_libary ) on your source file, and that you DO have one on your target directory. Keep this in mind if you're getting errors.
You could also use this method to store your Help files, sound files, etc...
The startup.rtf fileHomemade SuperCollider plugins are different and can easily be loaded remotely by creating a 'startup.rtf' file and placing it in your '/Users/username/scwork/' directory. If in SC3 you hit Cmd-j on 'Main', you will see that there is a 'startup' function that automatically loads a file called 'startup.rtf' if one exists. The line looks like this:
"~/scwork/startup.rtf".loadPaths;
Simply create that file and place in the correct spot. If you want to automatically load your custom plugins, simply place the following code in startup.rtf:
//-- LOAD HOMEMADE PLUGINS --//
// all plugins in this directory will be loaded
"SC_PLUGIN_PATH".setenv("~/scwork/aoSC_plugins/".standardizePath);
"echo \"Loading Plugins From '$SC_PLUGIN_PATH'\"".unixCmd;
Since SC3 doesn't have a Preferences menu enabled, you can use 'startup.rtf' to create certain default settings things up that you find yourself tweaking repeatedly, for instance the default font for new windows. Here's the code I use to set the default font for new windows AND to set the font for '.sc' files when they open:
// SET DEFAULT FONT TO VERDANA //
Document.initAction = { arg doc;
var testForNewFile, testForSCFile, defaultFont;
defaultFont = Font("Verdana", 10.5);
// Set default font for new windows -- not for already existing files (or else all formatting will be lost)
// ... path for new windows is Nil...
testForNewFile = { doc.path.isNil };
// Set Font and Syntax Colorize whenever opening a .sc file //
testForSCFile = { arg title; title.contains(".sc") };
case(
// If NewFile, then set Default Font to Verdana //
{ testForNewFile.value }, { doc.font_(defaultFont) }
// If opening a .sc file, Set Font to Verdana and syntax colorize for easier reading //
,{ testForSCFile.value(doc.title) }, { doc.font_(defaultFont); doc.syntaxColorize }
// Else, leave the file alone //
);
};
Check the 'Document' Help file for more window settings you might want to want to have set automatically. You can also set preferences for your default input and output setup (
PLEASE NOTE: For a number of personal reasons I am currently unable to support this page and am unable to respond to any further questions, requests, demands, etc posted here. I sincerely apologize for this. The material above is simply presented as archival material (some of it incomplete) of a project that I am not actively involved with anymore, and it will probably not be updated any further. You are free to use it in whatever non-commercial ways you wish (see the CreativeCommons license below). In addition, feel free to use the comments-section below to post ideas, solutions, or to ask questions, but with the understanding that any queries will have to be answered by the community at large - not by me. Thanks for understanding.
|
http://plus1plus1plus.org/Resources/SC3startupAndLinking
last updated 20 January 2010, at 10:52 AM PDT