Page 1 of 1

Help on Gates, Triggers and the ADSREnvelope class

Posted: Fri Jan 18, 2019 11:51 am
by AndyMac
Wanting to develop some utilities around gates/triggers. Gates seem relatively straightforward (+5 or 0) but I can't work out how to do Triggers properly.

Whilst looking at this, I looked at the ADSREnvelope class as a way to generate a short single-shot trigger but can't find the event/attribute to properly provide the gate to it!

Help please

Re: Help on Gates, Triggers and the ADSREnvelope class

Posted: Fri Jan 18, 2019 3:59 pm
by Cherry Dan
AndyMac wrote: Fri Jan 18, 2019 11:51 am Wanting to develop some utilities around gates/triggers. Gates seem relatively straightforward (+5 or 0) but I can't work out how to do Triggers properly.

Whilst looking at this, I looked at the ADSREnvelope class as a way to generate a short single-shot trigger but can't find the event/attribute to properly provide the gate to it!
Hi there,

In Voltage Modular, a trigger is just a single sample, typically set to 5.0 volts. It's not necessary to fade it out, though you certain can. You can also just use a very short gate signal, if you want.

Regarding the ADSREnvelope, the function SetGate(boolean gate) is used to set the gate on the envelope.

Thanks!
Dan

Re: Help on Gates, Triggers and the ADSREnvelope class

Posted: Fri Jan 18, 2019 4:43 pm
by AndyMac
Thanks - now found an easy way for the Gate - using the PercussionTrigger with an AttackHold of 0 and decay of 0 seems to work well :-) and this is easy to use given it has the Trigger() event that can be called against it!

On the ADSREnvelope, what are the time parameters measured in? And I have been trying to use the SetGate attribute - effectively in the following simple case using a button as a manual gate (and I'm probably doing something really stupid :-) - note adsr is the ADSREnvelope object)…


case Button_Changed:
{
if( doubleValue == 1 ) { adsr.SetGate( true ); }
if( doubleValue == 0 ) { adsr.SetGate( false); }
}


I also have an LED showing the state of the button, working fine, but this does not seem to be triggering the ADSREnvelope - at least as far as I can tell (no change in output voltage from GetValue() and no change of state from GetStage().

Re: Help on Gates, Triggers and the ADSREnvelope class

Posted: Thu Dec 10, 2020 9:17 pm
by Doc Joe
HI.

I am also trying to work out the best way to implement a button to trigger mod but am having trouble with the samples firing mutiple times from the buttons.

I've tried a few things, but can't see to get the pattern right.

I am using a status flag int called Trig1 to show off (0), just triggered (3) and to be triggered (5)

I have a button - button1 - which when pressed issues a notify. At that point, I set a status int called Trig1 to 5.

if (component == button1)
{
if ( doubleValue > 0 )
{
Trig1 =5;
}
}

In processsamples, I have the following code:

if ( outputJack1.IsConnected() )
{
if ( Trig1 == 3 )
{
// the tigger sample has been sent, so turn it off to ensure it is not resent
outputJack1.SetValue(0);
Trig1 = 0;
}
else if (Trig1 == 5)
{
// send a simple set to high (5)
outputJack1.SetValue(5);
Trig1 = 3;
}
}

Any help would be greatly appreciated.

Best regards,
Joe