How to trigger a function or a global variabel?

Hello everyone,

I haven’t coded for half year and am a bit rusty and out of shape. Need help!

I have a function that plays multiple synths in a global variable. I can play that cluster with


\random parameter1,
\random parameter2,
\random parameter3,

“” plays the thing.

How can I trigger it with a trigger? Is ther someting like tplay?

Another Question: How can I delay a the trigger within a Synthdef? I’d like that it randomly delays for flam-effect with percussif sounds.

cheers and thanks, Benu

.play on a function wraps the Synth in a SynthDef and plays it. I think the most common way to “trigger” it is by using Patterns like Pbind. For delaying the trigger, you can specify things like onset \delta etc. in Patterns, which can offset the synths according to their relation to the quantization/time they are set to. From help file:

Returns the inter onset time - the time delay until the next event in a sequence. This usually depends on \dur and \stretch, but may be overridden by specifying \delta directly.

If you want to do this from within a synth without using Patterns, you can use Demand rate Ugens like TDuty (Trigger Demand Ugen)

Is this what you are imagining? I’m relatively new, so there’s probably some other, more preferred way.

For my purpose I can’t do it with Pbind etc.

I’d like to trigger it from outside the box, with or similar.

@Benu It looks like you have to search for “trigger”
yourself, and see what you can come up with…

Feel free to keep the thread alive by posting your results… we may be able to suggest alternatives, once your (exact) intent is a little more clear… there are a lot of different ways to trigger a synth!

You can try doing a quick search for gate as well… whenever a ‘gate’ is involved, sending the gate a value of 1 will cause it to work like a trigger.

@Benu In the Amplitude help file, there is an example that shows how to use it for triggering a SinOsc. You could do the same with your Synth in a global variable, if you are trying to use analog audio to trigger Synths. You don’t necessarily need an extension (Coyote)…In a way “triggering synths” is kinda what SC…is all about.

Eli Fieldsteel has some video tutorials that show various ways, MIDI, onset detection, making a looper, photo cells, OSC based control for use with stuff like your cell phone, network, accelerometers,…you name it: