[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] Importing synthdef code
Thanks!
If anyone's interested, here's a code snippet that lists current loaded synthdefs without the system_ and freqscope defs (which are the bulk of the default synthdefs and don't make any noise):
(
"[myPath...]/mySynths.scd".load;
" ".postln;
SynthDescLib.global.synthDescs.do { |desc|
var thisString;
if(desc.def.notNil) {
thisString = desc.name;
if ((thisString.find("system", true, 0).isNil) && (thisString.find("freqScope", true, 0).isNil))
{thisString.postln};
};
};
" ";
)
Richard
On 28 Dec 2012, at 21:09, Daniel Mayer wrote:
>
> Am 28.12.2012 um 21:07 schrieb Richard Wentk:
>
>> Is it possible to import synthdef(s) from one or more files and have the interpreter work with them in the usual way?
>>
>> I can build classes and such, but I really want to know if something like
>>
>> #import [path]/mysynthdefs.sc
>>
>> is possible in the language.
>>
>
>
> Hi
>
> "pathToMySynthDefsFile".load;
>
> If you're going to do that in your startup file
> (not generally regarded as good practice
> as it might be forgotten and cause surprises later on)
> you would have to ensure
> that server is booted,
> so you could write something like
>
>
> s = Server.local;
> Server.default = s;
> s.boot;
>
> s.doWhenBooted { "pathToMySynthDefsFile".load }
>
>
> Or define a single project load file,
> which includes further load specifications.
>
> Greetings
>
> Daniel
>
> -----------------------------
> http://daniel-mayer.at
> -----------------------------
>
>
> _______________________________________________
> sc-users mailing list
>
> info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
> archive: https://listarc.bham.ac.uk/marchives/sc-users/
> search: https://listarc.bham.ac.uk/lists/sc-users/search/
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/