Kyma Forum
  Kyma Support
  Two queries...

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

next newest topic | next oldest topic
Author Topic:   Two queries...
JackRosete
Member
posted 19 June 2006 12:20         Edit/Delete Message   Reply w/Quote
I was wondering whether it is possible to use an array in the Value field of MIDIOutputController, the same with Channel and ControllerNumber fields, so that I can algorithmically specify a whole bunch of !Faders, channels and controller numbers? I have several hundred at present so I'm looking for a better solution that 100's of MIDIOutputControllers!

Or is there another prototype for this sort of thing?

Also, I was wondering whether there is a way to trigger the 'r' dice roll via MIDI?

Thanks!

Jack

IP: Logged

SSC
Administrator
posted 19 June 2006 19:44         Edit/Delete Message   Reply w/Quote
MIDI Program change 128 should roll the dice for you.

Any time you need a large number of Sounds whose parameters differ from one another in a systematic way, the Script module is probably the best way to go.

IP: Logged

JackRosete
Member
posted 02 July 2006 12:59         Edit/Delete Message   Reply w/Quote
How could I specify the following Script algorithmically?

HatsToggle start: 0 s HatsToggle: !HatsToggle01 Channel: 1 ControllerNumber: 1.
HatsToggle start: 0 s HatsToggle: !HatsToggle02 Channel: 1 ControllerNumber: 2.
HatsToggle start: 0 s HatsToggle: !HatsToggle03 Channel: 1 ControllerNumber: 3.
HatsToggle start: 0 s HatsToggle: !HatsToggle04 Channel: 1 ControllerNumber: 4.
HatsToggle start: 0 s HatsToggle: !HatsToggle05 Channel: 1 ControllerNumber: 5.
HatsToggle start: 0 s HatsToggle: !HatsToggle06 Channel: 1 ControllerNumber: 6.
HatsToggle start: 0 s HatsToggle: !HatsToggle07 Channel: 1 ControllerNumber: 7.
HatsToggle start: 0 s HatsToggle: !HatsToggle08 Channel: 1 ControllerNumber: 8.

Thanks!

IP: Logged

JackRosete
Member
posted 02 July 2006 13:32         Edit/Delete Message   Reply w/Quote
I thought maybe this should work but no success:

HatsToggle start: {(1 to: 16) collect: [:start | 0 s]} HatsToggle: {(1 to: 16) collect: [:HatsToggle | (!HatsToggle suffix2: HatsToggle)]} Channel: {(1 to: 16) collect: [:Channel | 1]} ControllerNumber: {(1 to: 16) collect: [:ControllerNumber | ControllerNumber]}.

IP: Logged

SSC
Administrator
posted 02 July 2006 16:17         Edit/Delete Message   Reply w/Quote
Maybe if you put the loop on the outside (rather than on the inside of your expression), for example

1 to: 8 do: [:i | hatsToggle start: 0 s toggle: 'HatsToggle' suffix2: i controlNbr: i]

IP: Logged

JackRosete
Member
posted 02 July 2006 17:24         Edit/Delete Message   Reply w/Quote
Can't seem to make it work!

In the code you gave me...

1 to: 8 do: [:i | hatsToggle start: 0 s toggle: 'HatsToggle' suffix2: i controlNbr: i]

...what does the toggle: mean? Is that a Smalltalk expression?

I've tried the following code based on your example:

1 to: 8 do: [:i | HatsToggle start: 0 s hatsToggle: 'hatsToggle' suffix2: i channel: 1 controllerNumber: i].

Not sure if I've misinterpreted your code though... I get this error message:

The message #abs, sent to 'hatsToggle', an instance of class ByteString, was not understood.

What am I doing wrong?

Thanks!

IP: Logged

JackRosete
Member
posted 02 July 2006 17:32         Edit/Delete Message   Reply w/Quote

Drumstation.kym

 
Would it help if you took a look at the portion of the Sound I'm working on? I'll upload it...

IP: Logged

JackRosete
Member
posted 02 July 2006 18:56         Edit/Delete Message   Reply w/Quote
I've made a couple of adjustments to the sound, and now I tried this code:

01 to: 16 do: [:i | hatsOutputControl start: 0 s
hatsSwitch: !HatsToggle suffix2: i
channel: 1
controllerNumber: i].

But again no luck! The code creates one fader called !HatsToggle, instead of 16 called !HatsToggle01, !HatsToggle02 etc. Can't figure out what's wrong!

[This message has been edited by JackRosete (edited 02 July 2006).]

IP: Logged

HectorBenard
Member
posted 02 July 2006 19:32         Edit/Delete Message   Reply w/Quote
Shouldn't 'hatsToggle' be a hot value? Something like: (1 to: 8) do: [:i | HatsToggle start: 0 s toggle: (!hatsToggle suffix2: i) channel: 1 controllerNumber: i ]. This still gives an error message though, and if I leave the parentheses out it only gives a single fader (ignoring the suffix2: i message)

One thing I find frustrating is that there is no reference in the manual to the use of suffix2, except for a couple of simple examples (and nothing in the smalltalk quickreference), so in cases like this it is difficult to look it up.

H

[This message has been edited by HectorBenard (edited 02 July 2006).]

IP: Logged

HectorBenard
Member
posted 02 July 2006 19:34         Edit/Delete Message   Reply w/Quote
Oops, you beat me to it!

Cheers,

H

IP: Logged

JackRosete
Member
posted 02 July 2006 19:47         Edit/Delete Message   Reply w/Quote
I've tried a number of combinations for the line:

hatsSwitch: !HatsToggle suffix2: i

with parenthesis and square brackets etc. But as you pointed out, these all give error messages, and without them the - suffix2: i - seems to have no effect.

Funnily enough - suffix2: i - works fine with collect: but not with do:

Unfortunately I can't get collect: working with the rest of the Script!

[This message has been edited by JackRosete (edited 02 July 2006).]

IP: Logged

HectorBenard
Member
posted 02 July 2006 20:20         Edit/Delete Message   Reply w/Quote
I see what you mean, but I think it's more a matter of the suffix2 message working in the context where you tried it with collect (as in the examples in the manual), but not in this context. When I try this:

(1 to: 8) collect: [:i | HatsToggle start: 0 s channel: 1 controllerNumber: i toggle: !hatstoggle suffix2: i].

I get the same result as with the do loop. It may have something to do with the fact that the suffix2 is being used at the same time as the green variables are being asigned a value, becuase it seems to work fine when you use it in a context that doesn't involve this scenario (but when you use do you just don't see the results posted).

IP: Logged

JackRosete
Member
posted 02 July 2006 20:38         Edit/Delete Message   Reply w/Quote
Yes, there could be a problem with the green variables in this scenario. I've been at it for hours and I can't think of any other solution that I haven't already tried. I think I'll have to wait and see if SSC can help me out!

Odd stuff

IP: Logged

SSC
Administrator
posted 02 July 2006 22:11         Edit/Delete Message   Reply w/Quote
OOPS! We left of some parentheses around the suffix2: message. They are needed so that Kyma knows that you mean to create a new hot variable (otherwise, Kyma thinks you are trying to set the green variable 'suffix2' to the value of i).

1 to: 8 do: [ :i | HatsToggle start: 0 s channel: 1 controllerNumber: i toggle: (!hatstoggle suffix2: i)].

IP: Logged

HectorBenard
Member
posted 02 July 2006 22:42         Edit/Delete Message   Reply w/Quote
That is the strange part, it still doesn't work with the parentheses! It still gives an error message.

[This message has been edited by HectorBenard (edited 02 July 2006).]

IP: Logged

JackRosete
Member
posted 03 July 2006 00:09         Edit/Delete Message   Reply w/Quote
I also get the following error message:

Error: The message #suffix2:, sent to 'HatsToggle, an instance of class ConcreteEvent, was not understood.

Am I right in thinking that Kyma is not recognising !HatsToggle as a hot variable for some reason?

IP: Logged

SSC
Administrator
posted 03 July 2006 09:52         Edit/Delete Message   Reply w/Quote
1 to: 8 do: [:i | HatsToggle start: 0 s hatsToggle: ('hatsToggle' asHotValue suffix2: i) channel: 1 controllerNumber: i].

(sorry, I dashed off the first response in rush just as I was leaving for the night--should have checked it before posting it). This one works.

IP: Logged

JackRosete
Member
posted 03 July 2006 10:53         Edit/Delete Message   Reply w/Quote
I had tried using asHotValue, but not with parenthesis. Shows how important the details are

Thanks!

IP: Logged

HectorBenard
Member
posted 03 July 2006 10:54         Edit/Delete Message   Reply w/Quote
Shouldn't !hatsToggle and 'hatsToggle' asHotValue be equivalent expressions? Why is there a difference if the latter results in the former when evaluated?

IP: Logged

SSC
Administrator
posted 03 July 2006 11:56         Edit/Delete Message   Reply w/Quote
In a Script, it's necessary to use the asHotValue message.

(It has to do with the order of when expressions get evaluated and when hot values are replaced with actual "event sources".)

IP: Logged

HectorBenard
Member
posted 03 July 2006 12:43         Edit/Delete Message   Reply w/Quote
I see. Thanks for the explanation!

H

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