Kyma Forum
  Kyma Support
  questions about encapsulating classes

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   questions about encapsulating classes
Phi Curtis
Member
posted 06 June 2006 00:10         Edit/Delete Message   Reply w/Quote

3Filters.kym

 
Hi,

I have a couple of questions:

If I want to encapsulate a class that I want to contain radio buttons that are present in the sounds that are inside the class (for example, the "type" field in a filter), how would I do it? I can't use green variables for that, since the field in the original object doesn't allow that.

Also (well, maybe this is a bug report and not a question) - if I edit an already encapsulated class using the Edit Class menu item, if I change the input/output types, input/output channels, nonaudio side effects box, or the icon, I can't seem to get the icon for the class to change. Or it does - kind of: When I double click on the encapsulated class, I see the changed icon, but if I drag it to a sound file, it reverts back to the old class. Unless it is a new sound file, in which case it stays the new icon.

Since this last one is a little hard to explain, I'll attach an example (something in progress)

Thanks,
Phil

IP: Logged

SSC
Administrator
posted 06 June 2006 10:55         Edit/Delete Message   Reply w/Quote

3FiltersWithType.kym

 
Here is an example for you to work with.

What we did was to use a ParameterTransformer to replace the field's value with a variable, and then choose the proper parameter type in the class editor (filterType). When making the class, you need to enter #lowPass when it asks for the value for the example.

=======================

Each icon is created and saved the first time it is used. One way to get Kyma to recalculate the icon is to change the size of the displayed icon (using Command+[ or Command+]), click the Recycle button, and change the size of the icon back.

IP: Logged

Phi Curtis
Member
posted 06 June 2006 22:46         Edit/Delete Message   Reply w/Quote
Thanks!

I hadn't had any occasion to use a parameter transformer yet, and had overlooked that part of the manual.

This part I'm not sure I understand:
snd doNotExpandFirst; doNotTransformSubSounds.

Is this equivalent to unchecking the "Expand" box in the Class Edit window? I actually just tried it without that line, and it still seems to work just fine, even without "Expand" being unchecked.

But now I'll be able to make prototypes without having to have one with a lowpass filter, another with a highpass filter, etc.

IP: Logged

SSC
Administrator
posted 07 June 2006 09:47         Edit/Delete Message   Reply w/Quote
doNotExpandFirst instructs the ParameterTransformer to work on the parameters of its inputs before they are expanded.

doNotTransformSubSounds instructs it to work on the immediate input only.

IP: Logged

Phi Curtis
Member
posted 30 June 2006 12:02         Edit/Delete Message   Reply w/Quote
Hi,

Continuing on with this encapsulated class, which has the type of filter being assigned to variable ?type by a ParameterTransformer, I was wondering if it would be possible to use a conditional within the filter which inquires the type of filter which has been selected. Something like this in the frequency field:

(?Bypass of: #( {?CutOff} {?type eq: #highPass true: 40 false:
SignalProcessor halfSampleRate})) smooth: 0.02 s

This doesn't seem to work, but I was wondering if something like this could be done.

Thanks,
Phil

[This message has been edited by Phi Curtis (edited 30 June 2006).]

IP: Logged

SSC
Administrator
posted 30 June 2006 14:32         Edit/Delete Message   Reply w/Quote
CapyTalk works with numbers only (no symbols). But maybe you could use an *index* corresponding to ?cutoff and ?type. In other words, you could set those question mark variables to integer index values and use *those* to select the desired values for the cutoff.

IP: Logged

Phi Curtis
Member
posted 30 June 2006 14:49         Edit/Delete Message   Reply w/Quote
quote:
Originally posted by SSC:
CapyTalk works with numbers only (no symbols).

I was afraid that was the case.

I think the problem with the index idea, if I'm understanding you correctly, is that I'm not sure which filter will be set by the user to be highpass, and which lowpass or allpass - I want to leave that unfixed. Oh well, this was only to try to be clever and avoid the additional cpu load of a single Gain object, with which I could implement the bypass with as well.

thanks,
Phil

IP: Logged

SSC
Administrator
posted 01 July 2006 10:22         Edit/Delete Message   Reply w/Quote
Actually, since the filter type is determined at compile time you can use Smalltalk (rather than CapyTalk, which is for run time):

| choices |

choices := Array with: ?Cutoff with: (?type == #highPass ifTrue: [40] ifFalse:
[SignalProcessor halfSampleRate]).

(?Bypass of: choices) smooth: 0.02 s

IP: Logged

Phi Curtis
Member
posted 01 July 2006 14:52         Edit/Delete Message   Reply w/Quote
Thanks - that's just what I was looking for. Works great, except that I have to watch the scale on the highpass, as the filter can overload at 40 hz. Is there any kind of rule of thumb about where the cutoff frequency, scale and steepness of the filter should be to avoid this?

IP: Logged

Phi Curtis
Member
posted 01 July 2006 20:09         Edit/Delete Message   Reply w/Quote
Here's a new encapsulating question:

When editing classes, how do I get text entered in the "Class Description" field in the class edit window to show up as help under individual parameter names? I write the name of the field and the comment specific to that parameter, but it doesn't show up when clicking on the field name.

thanks,
Phil

IP: Logged

SSC
Administrator
posted 01 July 2006 21:05         Edit/Delete Message   Reply w/Quote
When you select the parameter name in the Class editor, there is a small text field for entering a comment (help) for that parameter.

IP: Logged

Phi Curtis
Member
posted 03 July 2006 23:25         Edit/Delete Message   Reply w/Quote
quote:
Originally posted by SSC:
When you select the parameter name in the Class editor, there is a small text field for entering a comment (help) for that parameter.

Oops - I'd used it before, but I missed it this time.

I've posted my filter classes on the Tweaky - thanks for the help!

Phil

IP: Logged

All times are CT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply

Contact Us | Symbolic Sound Home

This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.


Ultimate Bulletin Board 5.45c