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 Stack Queue Arpeggio

Peak Valley Tally Kicker Repeats

StopWatch MacLoop# Flas


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 ArtWonk, 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.


Stack

Stack for value storage, last in first out (LIFO). This is the basic computer stack, like plates in a cafeteria stack. Items are put on top, and they are taken off the top. So the last one put in is the first one taken off. This stack is for numerical values, there is a corresponding TxStack for text strings. The stack is 1024 elements deep; when the limit is reached it simply stops placing items into the stack until some are removed to make space. Stack values and pointers are stored with the patch.

Outputs:

Top: Top of stack, last item Pushed.

Next: Next to top of stack:

Nth: Nth item on stack, selected by Nth input below.

Depth: Number of items currently on the stack.

Inputs:

InVal: Value to push to stack.

Push: Any change to push input to top of stack.

Pop: Any change to pop top of stack (last in), discarding previous.

Nth: Random address to return Nth item on stack. If address is > depth or <0, nothing (0) is returned.

Clear: Strobe to clear the stack.


Queue

Queue value storage, first in first out (FIFO). Like a line of people at a restaurant, with new arrivals going to the end of the line, and those who finally get a table leaving from the front of the line. Queues are handy for creating buffers when you have items being created and then consumed but the rates of creation and consumption are irregular. So the queue acts as temporary storage, with data placed in the queue, then removed again in the same sequence order. This queue is for numerical values, there is a corresponding TxQueue for text strings. The queue is 1024 elements deep; when full, the Enqueue change input is ignored until some items are dequeued to make additional room. The queue data and pointers are stored with the patch.

Outputs:

Queue: Least recent value entered (first in).

Depth: Current queue depth. When 0, the last valid item is in the Queue output; additional Dequeues set the Depth to -1 and the Queue output to 0.

Inputs:

InVal: Value to enqueue.

Enque: Any change to enqueue InVal (push to end of queue).

Deque: Any change to dequeue (first in), discarding previous.

Clear: Strobe to clear queue.


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.


Repeats

Sets output to NZ (1) for one cycle when a value repeats Count number of times. Useful both for determining if a process has wound down and is no longer producing a pattern; and also for determining if a process has finished initializing and is now properly producing its pattern.

Output:

Flag: NZ (1) for 1 cycle when input repeats exceed input Count.

Inputs:

In: Input stream to test for repeats.

Count: Number of repeats allowed before output goes true.

Excpt: Exception not counted as repeat (usually 0).

Strb: Strobe to test for repeats.

Chng: Any change to test for repeats.


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.

ArtWonk is Copyright © 2003-2014 by John Dunn and Algorithmic Arts. All Rights Reserved.