wcnt logo & demo sound

Intro to trigger modules Top

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.

trigger Top

The trigger module derives its output triggers from an input signal, not from a trigger input. Its definition is as follows.

trigger
trig1
    in_signal sampler1 out_l
    delay_time 0.0
    trigger_level 0.25
// out_trig
// out_not_trig
// out_wait_state
trig1

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.

on_off_trig Top

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.

trigger
trig1
    in_signal triwave1 out_output
    attack_time 10.0
    attack_level 0.5
    release_time 15.0
    release_level 0.25
    check_levels on
// out_trig
// out_not_trig
// out_attack_state
// out_release_state
trig1

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.

rnd_trigger Top

This trigger has one input which when triggers, a random choice is taken as to which of the two outputs to trigger.

rnd_trigger
trig1
    in_trig seq1 out_note_on_trig
    probability 0.75
    not_probability 0.75
// out_trig
// out_not_trig
trig1

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).

logic_trigger Top

Here is what the command line help for the logic_trigger looks like.

logic_trigger
username
// inputs for logic_trigger
    in_trig1 modulename outputname
    in_trig2 modulename outputname
// parameters for logic_trigger
    function and/or/xor/xornot
    precision integer_value
// outputs for logic_trigger
// out_trig
username

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:

  • and - output a trigger if in_trig1 and in_trig2 trigger simultaneously.
  • or - output a trigger if either input triggers.
  • xor - output a trigger if either input triggers as long as it's not simultaneously.
  • xornot - output a trigger only when in_trig1 triggers, but not if in_trig2 does simultaneously.

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.

wait_trig Top

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.

wait_trig
trig1
    in_trig1 clock1 out_phase_trig
    in_trig2 clock2 out_phase_trig
    min_wait_time 5.0
    max_wait_time 15.0
    count 4
// out_trig
// out_wait_state
trig1

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.

state_gate_trig Top

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_gate_trig
trig1
    in_trig clock1 out_phase_trig
    in_state seq1 out_note_play_state
trig1

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.

trig_switcher Top

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.

trig_switcher
sw_trig
    triggers
      synthmod
        name trig1
      synthmod
        name trig2
    triggers
    in_trig time1 out_bar_trig
sw_trig

Incase it's not blindingly obvious, in_trig causes a switch to the next wcnt_trigger to output the triggers of.

Home

Features

Basic usage

Sequencing

Sampling

Trigger modules

File inclusion

Groups and Copying

Miscelleneous

Download

About

Links

SourceForge.net Logo