Event Modules

Event modules process aperiodic events, something happing in time but not on a regularly occuring basis as with Clocks.

Edge Change Strb2Chng Sync FlipFlop FlipFlopR DurHold DelayHold DelayHoldMs

DelayLine DelayStep Arpeggio

Peak Valley Tally Kicker

StopWatch MacLoop# Flash


Edge

Detects the leading edge of a 0 to non zero transition, and produces a strobe pulse of exactly 1 tick.

Output:

Strb: Strobe upon 0 to NZ transition

Input:

In: Any value that changes from 0 to NZ


Change

Detects change in the input, producing a strobe pulse when it changes.

Output:

Strb: Strobe upon input change.

Input:

In: Any changing value.


Strb2Chng

Convert Strobe to Change by incrementing count.

Output:

Chng: Increments on each strobe.

Input:

Chng: Strobe for new change in output (increments output).


Sync

Synchronize a random event with a synchronizing event.

Output:

Strb: Strobe of synchronized inputs.

Inputs:

In: Event to be synchronized.

Sync: Synchronizing event, such as a clock.


FlipFlop

Emulates a classic logic circuit known as a "Set/Reset Flip-Flop." This is essentially a 1-bit memory circuit, and it is one of the core building blocks of digital computers. In the context of MusicWonk, it is like a wall light switch: once it is flipped, it stays there until it is flipped again.

The Set input causes the output to go True (1) when it receives a strobe (0 to non-zero transition). The output then stays at 1 until the Reset input gets a strobe, at which time the output goes to False (0) and stays there until the Set input gets another strobe, etc.

Output:

Out: 1 after Set, 0 after Reset.

Inputs:

Set: Strobe to Set output to 1.

Reset: Strobe to Reset output to 0.


FlipFlopR

Same as the FlipFlop module above, except a System Reset message will cause a Reset.

The Set input causes the output to go True (1) when it receives a strobe (0 to non-zero transition). The output then stays at 1 until the Reset input gets a strobe, or a System Reset, at which time the output goes to False (0) and stays there until the Set input gets another strobe, etc.

Output:

Out: 1 after Set, 0 after Reset.

Inputs:

Set: Strobe to Set output to 1.

Reset: Strobe to Reset output to 0.


DelayHold

This module looks for the start of the 0 to NZ transition at the Strb input, then it delays it according to the Dely input value, after which it holds the Out value to True (1) for the duration set by the Hold input, and then returns the output to False (0).

Time values are in ticks, same as Clocks and other tick based events, with 24 ticks equal a quarter note, 12 ticks to an eighth note, and so on.

Output:

Out: Output is 0 for Delay time, then 1 for Hold time, then 0.

Inputs:

Strb: Strobe to trigger off/on/off cycle.

Dely: Delay time in Ticks, 0 = no delay.

Hold: Hold time in Ticks, 0 = infinite hold.


DelayHoldMs

Looks for the start of the 0 to NZ transition at the Strb input, then it delays it according to the Dely input value, after which it holds the Out value to True (1) for the duration set by the Hold input, and then returns the output to False (0).

Time values are in milliseconds, 1000 milliseconds to a second. Use this module when you do not want the delay or hold times to change when you change the master tempo.

Output:

Out: Output is 0 for Delay time, then 1 for Hold time, then 0.

Inputs:

Strb: Strobe to trigger off/on/off cycle.

Dely: Delay time in milliseconds, 0= no delay.

Hold: Hold time in milliseconds, 0 = infinite hold.


DurHold

This module looks for the start of the 0 to NZ transition at the Strb input, then it holds the Out value to True (1) for the duration set by %On percent of Dur duration ticks, and then returns the output to False (0).

This module is useful for converting a single cycle strobe to a clock-like duration.

Time values are in ticks, same as Clocks and other tick based events, with 24 ticks equal a quarter note, 12 ticks to an eighth note, and so on.

Output:

Out: Clock-like On (1) then Off (0), with On time set by %On of Dur.

Inputs:

Strb: Strobe to trigger off/on/off cycle.

Dur: Set the overall duration in ticks (increments of the run loop interval) for purposes of calculating the actual On time, which will be the %On percent of this Dur value. Smaller values run faster. Valid range is 2 ticks on up. Values below 2 are set to 2.

% On: Sets the portion of the Dur duration that the output will be On (1). Values of 0% or less gives an On duration of exactly 1 tick; values of 100% or more sets the On duration to the full value of the Duration input except for the last tick at the end. Because clock timings are in ticks, the accuracy of the On duration time is limited to the number of ticks in the Duration.


DelayLine

Analog-like delay line for echo and delay effects. The delay line is always running, any value in the input is sent to the output after a delay of up to 1024 ticks.

Output:

Out: Copy of input value delayed by Delay ticks.

Inputs:

In: Value to delay.

Delay: Ticks to dealy (0-1023).


DelayStep

Clocked delay line for echo and delay effects. The delay line only steps when strobed, any value in the input is sent to the output after a delay of up to 1024 steps.

Output:

Out: Copy of input value delayed for the number of strobe clocks given in the Delay input.

Inputs:

In: Value to delay.

Delay: Steps to dealy (0-1023).

Strb: Strobe (as with a clock) to move the input values down the delay line.


Arpeggio

Converts an input strobe into four timed delay strobes, giving an arpeggio of a clock pulse, etc. The arpeggio module supplies the arpeggiated note pulse train; combine this with a pitch source driven by the arpegio Step output to get a full rhythm+pitch arpeggio.

Outputs:

Arp: Strobe on each step of arpeggio.

Arp1: Strobe on 1st step of arpeggio.

Arp2: Strobe on 2n step of arpeggio.

Arp3: Strobe on 3rd step of arpeggio.

Arp4: Strobe on 4th step of arpeggio.

Step: Arpeggio step 1-4, 0 if off.

Inputs:

Strb: Strobe to start arpeggio.

Dely1-4: Time in ticks to delay the step.

Hold1-4: Hold time in ticks for the step.


Peak

Report highest value since last reset.

Output:

High: Highest value since last reset.

Inputs:

In: Any numeric value.

Reset: Resets to current In input value.


Valley

Report lowest value since last reset.

Output:

Low: Lowest value since last reset.

Inputs:

In: Any numeric value.

Reset: Resets to current In input value.


Tally

Counts the number of different values seen since the last reset. Useful to check the value spread of processes.

Output:

Tally: Count of different values seen since reset (128 max).

Inputs:

In: Input stream to be tallied.

Reset: Strobe to reset counter.


Kicker

Tests to see if a sequence is stuck in a rut of just a few repeating values, and if so, it generates a strobe that can be used to kick the sequence generator out of its rut. A typical use would be to reseed a feedback process that has flattened out.

To use this module, set the period you want to monitor as number of quarter notes. So if you want to monitor a bar of 4 whole notes, set Period to 16. Then set the threshold to the minimum number of changes you want to happen within that period. Connect whatever is generating your value stream into the In input; whenever the sequence generator produces less than the threshold number of changes, the Kick output strobes. Use that output to stimulate your sequence generator.

Outputs:

Kick: Strobe if min different values not reached within period.

Tally: Count of different values seen since start of period.

Inputs:

In: Input stream to be monitored.

Period: Period in quarter notes (ticks * 24) to test.

Thrsh: Threshold minimum different values (128 max) in a period to prevent kick.


StopWatch

Reads elapsed time in seconds. Uses system multimedia timer, so it is accurate to 1 millisecond (.001 second) on most computers. Use the StrTime module to get a formatted time string for readout labels, etc.

Output:

Out: Elapsed time in seconds.

Inputs:

Time: NZ to start stopwatch, 0 to stop.


MacLoop# - Loop Macro Loop Number

This is a specialized module that is only useful within a Loop Macro. It returns the 0 based loop number at each loop iteration.

Output:

Loop: Loop number of parent Loop Macro.


Flash

This is a specialized module useful for making 1 tick strob values visible when connected to a Panel LED; It holds the output true (1) for about 100 milliseconds after a strobe.

Output:

Flash: Output held true (1) for about 100 milliseconds after strobe.

Input:

Strb: Strobe (0 to NZ transition) to flash output.

MusicWonk is Copyright © 2003-2008 by John Dunn and Algorithmic Arts. All Rights Reserved.