![]() |
![]() ![]() ![]() ![]() ![]()
|
next newest topic | next oldest topic |
Author | Topic: questions about encapsulating classes | |
Phi Curtis Member |
![]() ![]() ![]()
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, IP: Logged | |
SSC Administrator |
![]() ![]() ![]()
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 |
![]() ![]() ![]() 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: 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 |
![]() ![]() ![]() 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 |
![]() ![]() ![]() 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: This doesn't seem to work, but I was wondering if something like this could be done. Thanks, [This message has been edited by Phi Curtis (edited 30 June 2006).] IP: Logged | |
SSC Administrator |
![]() ![]() ![]() 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 |
![]() ![]() ![]() quote: 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, IP: Logged | |
SSC Administrator |
![]() ![]() ![]() 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: (?Bypass of: choices) smooth: 0.02 s IP: Logged | |
Phi Curtis Member |
![]() ![]() ![]() 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 |
![]() ![]() ![]() 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, IP: Logged | |
SSC Administrator |
![]() ![]() ![]() 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 |
![]() ![]() ![]() quote: 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 |
![]() ![]() |
This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.