Kyma Forum
  Kyma Support
  random trigger

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

next newest topic | next oldest topic
Author Topic:   random trigger
flo
Member
posted 14 August 2014 12:55         Edit/Delete Message   Reply w/Quote

SlowInterlockingCanons.kym

 
Hi,
I don't understand why this basic random trigger (sound "2voices", please use any sample with it) doesn't work - can you explain it to me?
Thanks.
Best,

Florian

IP: Logged

pete
Member
posted 14 August 2014 14:24         Edit/Delete Message   Reply w/Quote
Hi Florian

The reason it's not working is because pasted sounds (that travel through the stereo Kyma wires) like sample rate signals are limited to +/-1 (sort of). But it's actually a twos complement number which get absolutely down to exactly -1 but never quite makes absolute +1, more like 0.99999999999 so it never selects the second value in the array.

This is because zero is considered to be the first positive vaule and so there is one less value to uses for the highest positive value (which would be absolute one) and hence it doesn't quite reach value plus one in the way that it does reach minus one.

So you can make it work by adding 0.0000001 to the [SoundToGlobalController] L inside both gate fields (or just add 0.5 instead).

OR

Use !RandomNr instead of [SoundToGlobalController] L in the gate fields. Global Hot parameters are not limited to +/- 1. In this case you would have to make the SoundToGlobalController module silent and paste it in the final mixer, else it will disappear.

I hope this makes sense

Pete

IP: Logged

SSC
Administrator
posted 14 August 2014 14:27         Edit/Delete Message   Reply w/Quote
You could use

asLogicValue

after the Sound pasted into the Gate fields. This will ensure that the "1" is a true logical 1. (Audio signals are one two-billionth shy of a full 1 when used in Capytalk expressions).

IP: Logged

flo
Member
posted 15 August 2014 04:40         Edit/Delete Message   Reply w/Quote

SlowInterlockingCanons.kym

 
Hi,

thanks for the information and help! I followed Petes way (because I could remember it most easily), but now I have the problem that the same samples cannot be retriggered, probably because the trigger doesn't return to "0". I tried to solve this with PulseTrains (in the sound "Ensemble" in the attachment) but somehow it doesn't work. Do you have a solution to this problem?
Thanks in advance.
Best,

Florian


IP: Logged

pete
Member
posted 15 August 2014 07:43         Edit/Delete Message   Reply w/Quote
Hi Florian

It all depends what you want it to do.

If you want the trigger to randomly trigger one or the other, then put the formula that's in the gate field in brackets and multiply it by !Trigger.

Is this what you want?

IP: Logged

flo
Member
posted 15 August 2014 08:54         Edit/Delete Message   Reply w/Quote

SlowInterlockingCanons.kym

 

Hi Pete,
yes, that's what I want. But now I have the problem that both samples can be triggered simultaneously. Do you know how to prevent that? (sound Ensemble_2)
Thanks again.

Best,
Florian


IP: Logged

SSC
Administrator
posted 15 August 2014 09:07         Edit/Delete Message   Reply w/Quote
It doesn't return to 0 because you are adding something to the value. So, the solution is:

[STGC] L asLogicValue

(where, [STGC] is the Sound you have pasted into the Gate field).

This way, the value becomes a logic 1 or a logic 0.

IP: Logged

flo
Member
posted 15 August 2014 10:48         Edit/Delete Message   Reply w/Quote
es, but in the end I want to trigger up to 12 sounds randomly, therefore I multiplied it with 12 (!Trigger nextRandom abs * 12 rounded). How can I combine this with your idea? and the problem is still with this code that sometimes 2 samples simultaneously get triggered, where I want only 1 at a time. Please apologize if I misunderstood what you were saying.


IP: Logged

SSC
Administrator
posted 15 August 2014 11:24         Edit/Delete Message   Reply w/Quote
Hi Florian,

In your Ensemble_3 Sound, for example, you have

(!RandomNr of: #(0 0 1 0 0 0 0 0 0 0 0 0)) * !Trigger

The problem you are encountering is that !Trigger changes !RandomNr through the SoundToGlobalController, so your Sample sees !Trigger changing first, then !RandomNr. This is what is causing the occasional multiple triggers.

One way to prevent the random triggers is to sample and hold the random number:

((!Trigger sampleAndHold: !RandomNr) of: #(0 0 1 0 0 0 0 0 0 0 0 0)) * !Trigger

IP: Logged

pete
Member
posted 15 August 2014 22:51         Edit/Delete Message   Reply w/Quote
Hi Florian

I Haven't tried this but I think another way that might work (without the ghost triggers), is to put most of the hard work in one place like this....

If you wanted 12 samples then In the sound to global controller put

( ( ( ( !Trigger nextRandom abs )*12)truncated)+1)*!Trigger

with !RandomNr as the output as you have it at the moment.

and in each gate you put

!RandomNr eq: 1

!RandomNr eq: 2

etc

Make sure you don't use eq: 0 as that is the rest value when nothing should be triggered.


OR

In the sound to global controller put
( ( ( ( ( !Trigger nextRandom abs )*12)truncated)+1)*!Trigger)/12

and in each gate put

([soundToGlobalController] L * 12) eq: 1

([soundToGlobalController] L * 12) eq: 2

etc

If you don't want to put the STGC in the mixer.

Hope it helps

Pete

IP: Logged

flo
Member
posted 16 August 2014 06:58         Edit/Delete Message   Reply w/Quote
many thanks!
It works fine now.


IP: Logged

flo
Member
posted 16 August 2014 06:59         Edit/Delete Message   Reply w/Quote
thanks a lot, Pete. I'll try this out.

Florian

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