Kyma Forum
  Tips & Techniques
  Making arrays for "ExtraValues" in Sequencers?

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

next newest topic | next oldest topic
Author Topic:   Making arrays for "ExtraValues" in Sequencers?
Douglas Kraul
Member
posted 01 September 2004 12:43         Edit/Delete Message   Reply w/Quote
Is it possible to write a Smalltalk routine that will create an array in the "ExtraValues" field of a Sequencer much like you can do for "Pitches", "Velocities" and so on? I have written Smalltalk code to create an array in the correct format but the Sound Editor always places the code within a "#( <my code here> )" construct, and of course it no longer works.

Also, a related matter, say I want to parameterize the creation of value arrays for the Sequencer (or any other Sound that takes arrays). So, for example, use a "green variable" to set the length of the array being made. This cannot be done using the obvious method. Is there an alternative?

Thanks,

Doug

IP: Logged

SSC
Administrator
posted 02 September 2004 11:36         Edit/Delete Message   Reply w/Quote
The ExtraValues field expects an array of arrays. If you had two fixed sequences of extraValues, you could use the form:

{Array with: (!Freq 1000 500 750)
with: ( !Mod 0 0.75 0.25)}

To create the array algorithmically, you could concatenate an array containing just the hot value name with your algorithmically generated array. (In Smalltalk, you use a comma as the concatenation operator). So for example, in place of (!Freq 1000 500 750), you could use:

((Array with: !Frequency),
((1 to: 7) collect: [:i | !Freq suffix: i]))

It's not pretty! But it works...

IP: Logged

SSC
Administrator
posted 02 September 2004 12:10         Edit/Delete Message   Reply w/Quote
"use a "green variable" to set the length of the array being made"

There are two tricky bits to this one. First, you have to make the starting point into the green variable, not the ending point (you probably got the varIfTrue error message, right?). So you have to count down instead of up and then reverse the result:

((?count to: 1 by: -1) collect: [ :i | 'P' asHotValue suffix: i]) reverse

The second trick has to do with when the expression is evaluated and when an actual number gets substituted for the green variable. Because of the ordering of things, Kyma would not recognize the expression above as an Array if it is pasted directly into a parameter field.

Instead what you can do is to put a green variable representing the array itself into your AnalogSequencer parameter field. For example say that you put ?pitches into the Pitches parameter field. Then make the AnalogSequencer Sound (say you named it anaSeq) an input to a Script.

In the Script you could write:

anaSeq
start: 0 s
pitches: ((?count to: 1 by: -1) collect: [ :i | 'P' asHotValue suffix: i]) reverse


to construct an Array of faders for the Pitches field.

[This message has been edited by SSC (edited 02 September 2004).]

IP: Logged

Douglas Kraul
Member
posted 03 September 2004 07:28         Edit/Delete Message   Reply w/Quote
First thanks for the details on how to construct a proper ExtraValues field expression, and the hints on using parameter variables within Smalltalk expressions. Both suggestions worked as advertised.

I'm trying to combine both methods to calculate the ExtraValues array in a script. Here's the code I am using:

********

|pitches durs gatetimes vels extras|

pitches := ((?len to: 1 by: -1) collect: [ :i | ('Transpose' asHotValue + 60 + ('P' asHotValue suffix2: i)) rounded nn]) reverse.

vels := ((?len to: 1 by: -1) collect: [ :i | 'sw' asHotValue suffix2: i]) reverse.

durs := #(1).

gatetimes := #(0.9).

extras := Array with: ((Array with: 'TimeIndex' asHotValue), ((( ?len to: 1 by: -1) collect: [:i | (2 * (i - 1) / ?len) - 1]) reverse)).

seq start: 0 s
rate: 'BPM' asHotValue / 60
amp: 'Amp' asHotValue db
durations: durs
dutyCycles: gatetimes
pitches: pitches
velocities: vels
extras: extras.

*********

everything works as expected except the "extras" (?extras is in the ExtraValue field of the AnalogSequencer). It would seem that the array I am passing is basically ignored. If I expand the sound I see the pitches and velocities in the "Values" field but no evidence of the extras. As further evidence the hot value 'TimeIndex' shows up in the virtual control surface, indicating it was not "bound" to something the sequencer provided.

Not sure what to try at this point.

Thanks for all your wonderful help!

Doug


IP: Logged

SSC
Administrator
posted 06 September 2004 11:58         Edit/Delete Message   Reply w/Quote
I couldn't come up with a way to do this with green variables in the ExtraValue field. However, I'm wondering whether it might be possible to create the variable-length arrays directly in the parameter fields you want to control. Then you could step through them using (!BPM countTriggersMod: ?len). For example:

(!BPM countTriggersMod: ?len) of: ((Array with: 'TimeIndex' asHotValue), ((( ?len to: 1 by: -1) collect: [:i | (2 * (i - 1) / ?len) - 1]) reverse))

written directly into the TimeIndex parameter field.

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