Trig

Trig

A rhythmic computing system.

Load Trig Scheme definitions

This provides wrappers for the nodes.

(monolith:load "trig.scm")

Making a new trig page

This is done with monolith:trig-new.

(monolith:trig-new "trig")

Select it with monolith:page-select.

(monolith:page-select "trig")

Initalizing Trig With clock

After creating an instance of trig, it needs to be initialized with a clock. This is done with trigclk. Call this before doing anything else.

(trigclk (clock 0 120 4) "trig")

Executing Trig Instructions

After a trig is initialized with a clock, it can then execute instructions. Do this before attempting to get anything from it.

(trigex "trig")

Reading from wires

trigwget will read from a given wire in trig, given the wire ID. This expects to be a value in the range 1-8.

(trigwget 1 "trig")

How to make rhythms

Wires can be multiplied with the input clock signal to produce a rhythm.

Something like this should do it:

(clock 0 120 4)
(bdup)
(trigclk zz "trig")
(trigex "trig")
(trigwget 1 "trig")
(mul zz zz)
(tenvx zz 0.001 0.002 0.01)
(sine 1000 0.4)
(mul zz zz)

Executing Things in Parallel

Parallel reads can happen with the trigrex node, which stands for trigger re-execution. Internally, this creates a new reader that reads from the same chunk in memory. trigrex needs to be called before trigex. Otherwise, multiple playhead display will not show up.

A start cell position is required as an argument. In this case, this trigrex node is told to start at cell 18, the first cell of the third line. (cells are 1 indexed).

(trigrex 18 "trig")

The logic of trigrex is spawned inside of a node. So, everytime the patch is recompiled, it is reset. This ideally pairs well with monolith:trig-reset.

Reset On recompile

It's often useful to reset the playhead between recompiles. This keeps this in sync. To do this, place a call to monolith:trig-reset in the patch.

This will set the position to be the initial position, which is set to be the top-left cell 1 by default. At the time of writing, there is know way to change this from scheme (yet).

(monolith:trig-reset "trig")

Source Code

The main program source code for the trig page can be found at trig.c, with the core rhythm VM found at trigvm.c.