[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] Writing a new class ?
- To: sc-users@xxxxxxxxxxxxxxxx
- Subject: Re: [sc-users] Writing a new class ?
- From: Dan Stowell <danstowell@xxxxxxxxx>
- Date: Wed, 4 Mar 2009 19:48:03 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=amYfwdoiVSw/0+NAkKuny5TOCA5CP3T914kKOlGaK3Y=; b=U/kVM5TerF0G+CNT1fvMEXBtW/XARxLq2re3BN7vHPUqNdtlswMMAO0G7ZeV3Gi+lH f9I9bo+wnZum6UdgX0uBYaKnzIiePM6BOUbFNFR+hUSx4AU48DyzFlucJeRdWsYeEZZO bXT2mU2o8Wv0pM9gOon3c+NuUPXGGJRcM1bHg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=A7EEZCwwMFHQwrZiTv0wR4gt7Nb3zPyYGQy3y8UajNU6RVLujgp5eat9AjiiujRHTN GAsk8L37RsRtFSfHcBNB92sLC3bDNAiUdZ24NBtu6dGg1hjXDSr/dqgNEP7Q4aZAmKh2 +M+0gJ3yNgpcBkatuw8vcJ3/DFOxgU+MYrfK8=
- In-reply-to: <49AED415.5000503@xxxxxxxxx>
- List-id: SuperCollider users mailing list <sc-users.create.ucsb.edu>
- References: <49AECC95.4090501@xxxxxxxxx> <E34D88B0-C299-41D4-ACDA-8DB417DBC9ED@xxxxxxxxxxxxxxxxx> <49AED415.5000503@xxxxxxxxx>
- Reply-to: sc-users@xxxxxxxxxxxxxxxx
- Sender: owner-sc-users@xxxxxxxxxxxxxxxx
What sort of "global" do you want? You might be fine with environment
variables, named with a "~" at the start.
~test = 65; // run this line by itself
{ ~test * 2 }.value; // then this
They hang around long enough that you can often treat them as globals.
Dan
2009/3/4 kg <kg2007.kg@xxxxxxxxx>:
> Ok, it works.
> I've read (not entirely ...) the documentation, and I don't see something
> about that ...
> But, I've read that classes are the only global objects ... It's easier to
> make static global object, maybe I could infer that I must relaunch the
> interpreter ...
> brief,
> Thanks.
>
>
> Josh Parmenter a écrit :
>>
>> You need to save class files as Text files (with the .sc extension... see
>> save as).
>>
>> Then, they need to go into the class file path. I suggest putting them in
>> your Application Support Directory's Extensions. On OSX one of these is
>> located at ~/Library/Application Support/SuperCollider/Extensions .
>>
>> Recompile the library... then try:
>>
>> a = NewClass.new;
>>
>> Hope that helps.
>>
>> Josh
>>
>>
>> On Mar 4, 2009, at 10:46 AM, kg wrote:
>>
>>> Hi,
>>>
>>> I'm discovering supercollider langage. I'm trying to write a class.
>>> This is the code that I've wrote:
>>> NewClass {}
>>>
>>> This is the error that I obtain when I execute it:
>>> ERROR: Class not defined.
>>> in file 'selected text'
>>> line 1 char 8:
>>> NewClass¢ { }
>>> -----------------------------------
>>> nil
>>>
>>>
>>> What's happenning ? (It's difficult to make an easier code that it ...)
>>>
>>>
>>> Thx in advance.
>>>
>>>
>>> _______________________________________________
>>> 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/
>>
>> ******************************************
>> /* Joshua D. Parmenter
>> http://www.realizedsound.net/josh/
>>
>> “Every composer – at all times and in all cases – gives his own
>> interpretation of how modern society is structured: whether actively or
>> passively, consciously or unconsciously, he makes choices in this regard. He
>> may be conservative or he may subject himself to continual renewal; or he
>> may strive for a revolutionary, historical or social palingenesis." - Luigi
>> Nono
>> */
>>
>>
>> _______________________________________________
>> 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/
>
--
http://www.mcld.co.uk
_______________________________________________
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/