trigRate Control

Hey,

I would like to achieve a movement (probably exponential) from short bursts with a percussive envelope to fewer hits with longer sustain/release with pattern control via MIDI cc (NanoControl is working thats not the problem) or via the Pattern itself.

For this instance i was trying to control the trigRate inside a Pattern and was coming up with the following conclusion. but its not working. I get stacked synth on the server and \trigRate is not doing anything.

t_trig = Impulse.kr(trigRate);
env = EnvGen.kr(Env([0.001,1,0.3,0],[atk,sus,rel],-4, 2, nil), t_trig);


Pbindef(\test,
	\instrument, \test,
	\trigRate, 1.0,
).play(t, quant:1);

Whats wrong here and is there a better solution? because even if controlling the \trigRate would work the envelope would still stay the same.
thanks

If you want repeating notes, there are two ways to do it:

  1. Run a pattern to play one synth per note.
  2. Play one synth, that re-triggers the envelope.

#1 assumes that the envelope will run one time, and delete the node after (doneAction: 2).

#2 assumes that the envelope will not delete the node, allowing retrigger.

The problem with the buildup of synths is that you’re trying to do both of them at the same time. Using Impulse as the gate is #2. Pbindef is #1.

If you want to do it with the Impulse, then make one synth e.g. synth = Synth(\trigPerc, ...).

If you want to do it with the Pbindef, then remove the Impulse, do env = EnvGen.kr(Env(...), doneAction: 2), and convert the trigger rate into duration by:

Pdefn(\trigRate, 1);  // the MIDI controller can change this value

...
	\dur, 1 / Pdefn(\trigRate)

hjh

thanks @jamshark70 for your fast reply this i working fine.
went for the Pbindef method and doneAction:2.
Was also dividing sustain/release with \trigRate to change the envelope shape for shorter notes.
But I´m not sure if I like the envelope behaviour now.

\sus, 0.3 / Pdefn(\trigRate),
\rel, 0.1 / Pdefn(\trigRate),

is there a mathematical procedure to make it a bit more smooth?
I´m trying to adjust the curve values as well :slight_smile: