Kyma Forum
  Kyma Support
  Scripts - Generating Hotparameters

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

next newest topic | next oldest topic
Author Topic:   Scripts - Generating Hotparameters
BobTheDog
Member
posted 23 May 2009 12:16         Edit/Delete Message   Reply w/Quote
Hi Guys,

I have tried a few things with no luck and have started banging my head against the desk.

Its it possible to generate hotparameters in a script and pass them as parameters?

Basically I want to pass an :amp parameter but I want to generate a hotparameter for each one with a different name, say !Amp01, !Amp02 etc.

Any ideas?

Andy


IP: Logged

SSC
Administrator
posted 23 May 2009 15:18         Edit/Delete Message   Reply w/Quote
You could use the Smalltalk collect: message, for example:

1 to: 10 collect: [:i | !Amp suffix2: i]

This could be passed as an argument in a Script. Or if you would like to paste it directly into an Array field (for example in the Amplitudes field of a SyntheticSpectrumFromArray), you can use it within curly braces so it is evaluated first and then interpreted as an array.

{1 to: 10 collect: [:i | !Amp suffix2: i]}

You can also select the expression and use Ctrl+Y to evaluate it and then use the generated hot values directly.

Or use the shortcut:

!Amp01 copies: 10

IP: Logged

BobTheDog
Member
posted 23 May 2009 15:48         Edit/Delete Message   Reply w/Quote
Hi, Thanks for the info.

I had been trying to use a similar method but I keep getting the following error:

"Error: The messafe #suffix2:, sent to `Amp, an instance of class ConcreteEvent, was not understood."

Here is the script changed to use the array idea:

| freqArray ampArray dspCount curDsp curAmp |

freqArray := #(0.25 0.5 0.0 1.5 2.0 3.0 4.0 5.0 8.0 16.0).
ampArray := 1 to: 10 collect: [:i | !Amp suffix2: i] .
dspCount := 4.
curDsp := 1.
curAmp := 1.

freqArray do:
[:freq |
RunOnDSP Start: 0 s dsp: curDsp FreqMul: freq NumOsc: 225 amp: ampArray at: curAmp.
curDsp := (curDsp mod: dspCount) + 1.
curAmp := curAmp+1.
].


IP: Logged

BobTheDog
Member
posted 24 May 2009 00:30         Edit/Delete Message   Reply w/Quote
Hi Guys,

Managed to get it working like this:

| freqArray ampArray dspCount curDsp curAmp hotVal |

freqArray := #(0.25 0.5 0.0 1.5 2.0 3.0 4.0 5.0 8.0 16.0).
ampArray := #(!Amp01 !Amp02 !Amp03 !Amp04 !Amp05 !Amp06 !Amp07 !Amp08 !Amp09 !Amp10).
dspCount := 4.
curDsp := 1.
curAmp := 1.

freqArray do:
[:freq |
hotVal := ampArray at: curAmp.
RunOnDSP Start: 0 s dsp: curDsp FreqMul: freq NumOsc: 225 amp: hotVal.
curDsp := (curDsp mod: dspCount) + 1.
curAmp := curAmp+1.
].


Cheers

Andy

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