![]() |
![]() ![]() ![]() ![]() ![]()
|
next newest topic | next oldest topic |
Author | Topic: Please help me with the script | |
Phi Curtis Member |
![]() ![]() ![]()
I'd like to create a script that wires together a sound like the sound called "Switch4" in the enclosed sound file. "Switch4" is a simple sound that allows the user to switch between 4 different inputs. The reason I want it to be implemented in a script is so that the user can specify the actual number of inputs he/she wants. The accomanying sound is my best attempt so far. The problem is in creating the Arrays that should go in the gains. I would like to test :r in the collect: loop against i: in the larger, enclosing do: loop, but when I attempt to reference i I am told that i is an undeclared variable. // For those reading along at home and not looking at the sound, here's the script: default := 60 nn hz. 1 to: ?nbrInputs do: [:i | // My thought was that, in comparing r against i, if r=i, then that item in the array should be set to 1. If r=i evaluates to false, then the item would be set to 0. It is my impression that I need curly brackets around the collect: loop, but every time I try to put them there I am not allowed to exit the box. I am told that for expressions containing hot values or variables, I need to use vmin:, vmax: varIfTrue: etc. I can't seem to find an expression using these that works and allows me to attempt a compile. When I don't have the curly brackets, whatever I try to do in the loop seems to be ignored. thanks, IP: Logged | |
SSC Administrator |
![]() ![]() ![]() I think it's a case of the dreaded missing parentheses ![]() The argument to switcher is an expression that has a colon and the rest of the expression after that colon was interpreted as another parameter value. Here it is with parantheses installed: | default | default := 60 nn hz. 1 to: ?nbrInputs do: [:i | switch start: 0 s (sorry the forum doesn't preserve tabs) 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.