First time here? Check out the FAQ!
x

What is the most elegant way to algorithmically generate SoundToGlobalControllers?

0 votes
843 views

Hi everyone,

I'm sure the answer already exist somewhere but I'm looking for a hint...

Looking at the 'EuSeq-McClain Metal Bar ModalFilter KBD' prototype and I like the TimbreDice feature so I want to implement the same idea in a sound I'm building. I know how to do it the laborious way with 32 SoundToGlobalControllers but wouldn't it be nice to be able to put a 'collect' message in the GeneratedEvent parameter field, like this?

{(1 to: 32) collect: [ : i | !Timbre suffix2: i]}

I've arrived at a close solution with the TransformEventValues prototype but I lose the functionality of the SourceEventValues, which I don't want to happen.

I've also explored the replicator but can't get it to behave the way I want it to in the context of my sound.

Thanks in advance for any thoughts or suggestions!

http://kyma.symbolicsound.com/qa/?qa=blob&qa_blobid=7645835096036560219

asked Oct 15, 2018 in Capytalk & Smalltalk by will-klingenmeier (Adept) (1,270 points)
edited Oct 24, 2018 by will-klingenmeier

1 Answer

+1 vote
 
Best answer

Hi Will,

If you have a SoundToGlobalController with !Timbre as its GeneratedEvent, then feed it to a Replicator with Number set to 32, it would create 32 SoundToGlobalControllers that generate !Timbre01, !Timbre02, etc. Is that what you'd like to end up with? Check the box that says RenameSpecialEvents and list !Timbre as a special event if you want to make sure you are renaming the !Timbre events only.

Here is an example showing how to make a roll-the-dice set of 32 Velocity potentiometers with Replicator.

answered Oct 15, 2018 by ssc (Savant) (126,300 points)
selected Nov 1, 2018 by will-klingenmeier
Thanks! That makes sense as far as the replicator goes. I do have another question though that is more specific to my sound. I used the TransformEventValues prototype to transform switches in the VCS to toggle with MIDI Note-on information with this bit of code:

SourceEventValues
{(1 to: 16) collect: [ : i | !sw suffix2: i]}

TransformedEventExpressions
{(36 to: 51) collect: [ : i | !KeyDown toggleWhen: (!KeyNumber eq: i)]}

And it works just the way I want it to, the puzzle I'm running into is I can't seem to replicate the switches to get the dice feature and transform the switches in the same sound, or can I, and I just need to get my order of operations correct? Does that make any sense at all or have I gone mad?
What values do want to randomize when you press the button? Do you want random switches to turn on/off (whether or not you play the keyboard?)
At this point I would like to have two separate buttons, one for the switches dice and one for the pitches dice. Yes, to random switches turn on/off once I press the switches dice button. I’ve got it working, I was just trying to find a simpler way than to make 16 STGC for the switches/keyboard.
What EventExpression are you using in your STGC example?
In the STGC it looks like this:

GeneratedEvent
!sw01

Value
!KeyDown toggleWhen: (!KeyNumber eq: 36)

I have 16 STGC and each one increments the !KeyNumber and the !sw by one.
I have another puzzle regarding this sound: Once I trigger the switch dice or roll the dice with the computer keyboard I still here sound even if I toggle all the switches off. I've meticulously gone through every branch of the sound and can't seem to find the reason. Any thoughts or suggestions?
Maybe your randomly generated switches are not limited to 0 or 1? Are you using them as amplitude scales? If you upload the Sound here, we would be happy to take a look.
I've uploaded the latest iteration. Thanks for your willingness to help!
Looks like you are using the switch values (!SW01 etc) as Velocities (which are in turn used as amplitude scales). In your random expression you are taking the absolute value of the random [-1,1] number. But I think what you intended is that they should be either 0 or 1, right?
If so then you can get this result by changing the expression in your STGC to:
!SwDice nextRandom asLogicValue
Then a stage is either on (amplitude of 1) or off (amplitude of 0).
Right! Makes sense-That solves that. More questions soon I'm sure. Thanks so much!
When you were playing with the sound did you notice that after 'rolling' the !SwDice the toggle with the !KeyDown events doesn't always happen on the first !KeyDown? Sometimes it does and sometimes it takes two events to toggle- like the first !KeyDown doesn't register. I've been trying some variations in the Value field of the SwDice STGC but haven't found a consistent solution. Maybe that's not even where I need to be working?
Hi Will, I tried it again tonight and, for whatever reason, it seems to be working ok on my setup (I was trying it with a LinnStrument hooked up to the USB input of the Pacarana). I did have to change the Channel on the MIDIVoice from 2 to channel 1 (but that should affect things). Is it possible that might be holding down more than one key at a time sometimes? (When I was trying it just now, I was playing in an exaggeratedly staccato style so maybe that's a possibility?)
Interesting. Thanks for double checking. I'm using it with Playtronica and I'm sure I'm only holding down one 'key' at a time (in this case touching gourds). I've noticed that the MIDI events log in the MIDI messages and the 'm' shows in the DSP status window but it just doesn't always toggle on the first event. Could there be something else I could try?
...