<- Implementation
Evaluation model

The evaluator (the compute_signals() function) is very simple: for each cycle, we compute an "output" array of signal buffers from the current signal array (sig_table) and then we copy that output array back to sig_table. It is thus completely synchronous, just like a Game of Life evaluator.

The signal buffers are all dynamically allocated inside the component operations and then freed by the evaluator, to allow polymorphic components to work on signal buffers of any size.

One important consequence of that evaluation model is that signals "propagate" through the circuit at the speed of one component per cycle. This is different from most evaluation models: in these models, a signal will propagate through an acyclic graph instantly. The case of cyclic graphs is then handled by breaking each cycle explicitly (e.g. Faust) or implicitly (e.g. Jack) with a delay.

Thus, the rendition of bytebeat programs as expressed in the demo circuit is not identical to the C version, because the "t" argument propagates through several branches of the circuit and these branches have different lengths. In my circuit, the corresponding desynchronization can reach 15 cycles (roughly 20 milliseconds). In spite of this, it sounds quite close to the true version.

© 2000-2014 Mikael Bouillot (last updated 2014-05-19)