Trigger based modules have the main purpose of outputing a trigger at various intervals. In wcnt a trigger is either on or off and when it is on it is so for a single sample and returns back to it's resting state of off at the next sample, until the next trigger occurrs.
Many different types of modules utilise trigger based inputs and outputs. The sequencer reads riffs and outputs various triggers depending on it's position relative to the notes. The clock based modules output a trigger at the start of every cycle of their phase. The trigger based modules may be used to manipulate triggers from outputs.
The trigger module derives its output triggers from an input signal, not from a trigger input. Its definition is as follows.
The out_trig output triggers once in_signal rises above the value set for trigger_level. At the same time out_wait_state is set on until in_signal drops below the trigger_level. When this happens out_not_trig triggers and out_wait_state is turned off.
The delay_time setting delays out_not_trig from triggering for the specified time (ms) and consequently out_wait_state is on for longer.
The on_off_trig module is similar to the trigger module but operates slightly differently. It still has the same two trigger outputs, but has time and level parameters for each of them.
The out_trig output corresponds with the attack parameters, and out_not_trig with release.
When in_signal climbs above attack_level out_trig triggers, and out_attack_state is turned on. It then waits for attack_time milliseconds and depending on check_levels, either turns off out_attack_state, or waits until in_signal falls below attack_level to do so. It then starts the same process with the release parameters and out_not_trig.When check_levels is off the release_level can be greater than the attack_level, otherwise it must be less.
This trigger has one input which when triggers, a random choice is taken as to which of the two outputs to trigger.
If the probability is met that out_trig should trigger then it does so, but if not, and the probability is met that out_not_trig should trigger then that does instead. (Otherwise neither of them trigger).
Here is what the command line help for the logic_trigger looks like.
The function parameter can only accept one of the function types. In the help they are all displayed so you know what they are. The four functions operate as follows:
The precision parameter controls the maximum number of samples apart the two inputs may trigger for the module to treat as simultaneous. The precision parameter was primarily created for operating on triggers from the sequencer and sync_clock because more often than not they are one sample out of step with each other.
This module waits for in_trig2 to trigger, and then allows in_trig1 to trigger out_trig a specific number of times, and then returns to waiting for in_trig2 again.
Just to complicate matters it has the two wait_time parameters which are specified in milliseconds and are taken from the last time out_trig triggered. If min_wait_time has not expired when in_trig2 triggers, then wait a bit longer for it to do so. Conversly, if the max_wait_time has expired while waiting for in_trig2 then stop waiting and output in_trig1.
The parameter count is how many times to allow in_trig1 to trigger out_trig before returning to wait for in_trig2 again.
See examples/waittest.wc for a simple demonstration.
The state_gate_trig is the most simple of all the trigger modules. If in_trig triggers, and in_state is on then output the trigger to out_trig.
State ouputs are similiar to trigger outputs in that they are either on or off but can be on for many samples instead of just one like a trigger.
The trig_switcher is used to switch between two or more trigger outputs. But first of all the outputs from whichever module they come from have to be connected to a wcnt_trigger module. The wcnt_trigger module has no other use and does nothing that the original output does not do (except be added to a trig_switcher). Here's its definition in a space saving one-line manner.
wcnt_trigger trig1 in_trig squwave out_pulse_off_trig trig1
Once you have atleast a couple you can then add them to a trig_switcher module.
Incase it's not blindingly obvious, in_trig causes a switch to the next wcnt_trigger to output the triggers of.